mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
89f089e439
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
14 lines
317 B
JavaScript
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);
|
|
});
|