Rounded MRR in dashboard
refs https://github.com/TryGhost/Team/issues/1602 - Added `cents` option to ghPriceAmount helper. - Removed cents from MRR in dashboard.
This commit is contained in:
parent
53c93f7fd7
commit
2b4e80b3dd
@ -78,7 +78,7 @@ export default class Mrr extends Component {
|
||||
return '-';
|
||||
}
|
||||
|
||||
const valueText = ghPriceAmount(this.currentMRR);
|
||||
const valueText = ghPriceAmount(this.currentMRR, {cents: false});
|
||||
return `${this.mrrCurrencySymbol}${valueText}`;
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import {formatNumber} from './format-number';
|
||||
import {helper} from '@ember/component/helper';
|
||||
|
||||
export function ghPriceAmount(amount) {
|
||||
export function ghPriceAmount(amount, {cents = true} = {}) {
|
||||
if (amount) {
|
||||
let price = amount / 100;
|
||||
let price = cents ? amount / 100 : Math.round(amount / 100);
|
||||
if (price % 1 === 0) {
|
||||
return formatNumber(price);
|
||||
} else {
|
||||
@ -14,6 +14,6 @@ export function ghPriceAmount(amount) {
|
||||
}
|
||||
|
||||
// like {{pluralize}} but formats the number according to current locale
|
||||
export default helper(function ([amount]) {
|
||||
return ghPriceAmount(amount);
|
||||
export default helper(function ([amount], options = {}) {
|
||||
return ghPriceAmount(amount, options);
|
||||
});
|
||||
|
@ -395,7 +395,7 @@ export default class DashboardMocksService extends Service {
|
||||
this.mrrStats = stats.map((s) => {
|
||||
return {
|
||||
date: s.date,
|
||||
mrr: s.tier1 * 500 + s.tier2 * 2500,
|
||||
mrr: s.tier1 * 501 + s.tier2 * 2500,
|
||||
currency: 'usd'
|
||||
};
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user