Updated MRR display value on dashboard

closes https://github.com/TryGhost/Team/issues/568

Displaying amount in cents in context of overall MRR forecast/estimate doesn't add much value, the change rounds MRR value to nearest whole number on dashboard
This commit is contained in:
Rish 2021-03-24 21:26:16 +05:30 committed by Rishabh Garg
parent fde76becc4
commit 43c83c77f2

View File

@ -82,7 +82,7 @@ export default class DashboardController extends Controller {
};
if (currencyStats) {
const currencyStatsData = this.membersStats.fillDates(currencyStats.data) || {};
const dateValues = Object.values(currencyStatsData).map(val => val / 100);
const dateValues = Object.values(currencyStatsData).map(val => Math.round((val / 100)));
const currentMRR = dateValues.length ? dateValues[dateValues.length - 1] : 0;
const rangeStartMRR = dateValues.length ? dateValues[0] : 0;
const percentGrowth = rangeStartMRR !== 0 ? ((currentMRR - rangeStartMRR) / rangeStartMRR) * 100 : 0;