fix: use correct number format (#47)

This commit is contained in:
Kim Truong 2019-04-09 20:37:00 -07:00 committed by Yongjie Zhao
parent 5a643dd047
commit ec5be03d8f

View File

@ -63,7 +63,7 @@ export default function transformProps(chartProps) {
const compareValue = sortedData[compareIndex][metricName]; const compareValue = sortedData[compareIndex][metricName];
percentChange = percentChange =
compareValue === 0 ? 0 : (bigNumber - compareValue) / Math.abs(compareValue); compareValue === 0 ? 0 : (bigNumber - compareValue) / Math.abs(compareValue);
const formatPercentChange = getNumberFormatter(NumberFormats.PERCENT_CHANGE_1_POINT); const formatPercentChange = getNumberFormatter(NumberFormats.PERCENT_SIGNED_1_POINT);
formattedSubheader = `${formatPercentChange(percentChange)} ${compareSuffix}`; formattedSubheader = `${formatPercentChange(percentChange)} ${compareSuffix}`;
} }
} }