Ghost/ghost/admin/app/helpers/format-number.js
Kevin Ansfield 91873d1857 Improved number formatting in members screen
no issue

- added `format-number` helper that uses browser's built-in `toLocaleString()` method to format numbers such as adding commas or periods to improve number readability (`123,000` instead of `123000`)
- updated members chart totals to use the helper
- replaced direct `.toLocaleString()` usage with the new helper so we can change global number formatting if needed
2020-05-26 14:40:03 +01:00

10 lines
226 B
JavaScript

import {helper} from '@ember/component/helper';
export function formatNumber(number) {
return Number(number).toLocaleString();
}
export default helper(function ([number]/*, hash*/) {
return formatNumber(number);
});