Ghost/ghost/admin/app/helpers/format-number.js
Kevin Ansfield 89f089e439 Fixed incorrect member count and capitalisation in publish options for editors/authors
no issue

- `{{format-number}}` was showing "0" when passed in an empty/nullish string when it should have been showing nothing
- used `{{if-empty}}` to fix capitalisation when the member count is missing
  - previously attempted a CSS-only fix with `:first-letter` and `text-transform: uppercase` but that broke the layout in Safari
2022-05-18 09:42:44 +01:00

14 lines
317 B
JavaScript

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