mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
91873d1857
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
10 lines
226 B
JavaScript
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);
|
|
});
|