diff --git a/ghost/admin/app/components/dashboard/v5/charts/mrr.js b/ghost/admin/app/components/dashboard/v5/charts/mrr.js index 891ff9c19f..6c18123159 100644 --- a/ghost/admin/app/components/dashboard/v5/charts/mrr.js +++ b/ghost/admin/app/components/dashboard/v5/charts/mrr.js @@ -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}`; } diff --git a/ghost/admin/app/helpers/gh-price-amount.js b/ghost/admin/app/helpers/gh-price-amount.js index d90c326486..84c2d13514 100644 --- a/ghost/admin/app/helpers/gh-price-amount.js +++ b/ghost/admin/app/helpers/gh-price-amount.js @@ -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); }); diff --git a/ghost/admin/app/services/dashboard-mocks.js b/ghost/admin/app/services/dashboard-mocks.js index 5a2be4b3b3..9258e4c5d4 100644 --- a/ghost/admin/app/services/dashboard-mocks.js +++ b/ghost/admin/app/services/dashboard-mocks.js @@ -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' }; });