diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-08-13 12:22:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-13 12:22:33 +0200 |
commit | 0e9668051e58b2ff4e48b82fa7cc17d385c7a5c9 (patch) | |
tree | af1b5b9ccceb0c3dcb38e18ffdf4f44b3c43c8be /app | |
parent | c09ecbc53eb3d3a8a1e2a1e61e20c9e5dbd4f560 (diff) |
Fix short number formatting for numbers above million in web UI (#11559)
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/mastodon/utils/numbers.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/mastodon/utils/numbers.js b/app/javascript/mastodon/utils/numbers.js index fdd8269ae..f7e4ceb93 100644 --- a/app/javascript/mastodon/utils/numbers.js +++ b/app/javascript/mastodon/utils/numbers.js @@ -4,7 +4,9 @@ import { FormattedNumber } from 'react-intl'; export const shortNumberFormat = number => { if (number < 1000) { return <FormattedNumber value={number} />; - } else { + } else if (number < 1000000) { return <Fragment><FormattedNumber value={number / 1000} maximumFractionDigits={1} />K</Fragment>; + } else { + return <Fragment><FormattedNumber value={number / 1000000} maximumFractionDigits={1} />M</Fragment>; } }; |