Ghost/ghost/admin/app/helpers/format-number.js

14 lines
344 B
JavaScript
Raw Normal View History

import {helper} from '@ember/component/helper';
2022-05-31 18:38:43 +03:00
export function formatNumber(number, options) {
if (number === '' || number === null || number === undefined) {
return;
}
2022-05-31 18:38:43 +03:00
return Number(number).toLocaleString(undefined, options);
}
export default helper(function ([number]/*, hash*/) {
return formatNumber(number);
});