diff options
author | Takeshi Umeda <noel.yoshiba@gmail.com> | 2019-12-30 00:59:25 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-12-29 16:59:25 +0100 |
commit | 0e8c0287d01d270238aeb7f25c6337b2bcb8afba (patch) | |
tree | 83688e64193c4ed9220515076c1ec919959f30db | |
parent | 162dc845a04741f15d0d8ca70e17f1ee9ed38841 (diff) |
Fix shortNumberFormat to within 3 chars without units (#12706)
-rw-r--r-- | app/javascript/mastodon/utils/numbers.js | 8 | ||||
-rw-r--r-- | app/javascript/styles/mastodon/components.scss | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/app/javascript/mastodon/utils/numbers.js b/app/javascript/mastodon/utils/numbers.js index f7e4ceb93..af18dcfdd 100644 --- a/app/javascript/mastodon/utils/numbers.js +++ b/app/javascript/mastodon/utils/numbers.js @@ -4,9 +4,13 @@ import { FormattedNumber } from 'react-intl'; export const shortNumberFormat = number => { if (number < 1000) { return <FormattedNumber value={number} />; - } else if (number < 1000000) { + } else if (number < 10000) { return <Fragment><FormattedNumber value={number / 1000} maximumFractionDigits={1} />K</Fragment>; - } else { + } else if (number < 1000000) { + return <Fragment><FormattedNumber value={number / 1000} maximumFractionDigits={0} />K</Fragment>; + } else if (number < 10000000) { return <Fragment><FormattedNumber value={number / 1000000} maximumFractionDigits={1} />M</Fragment>; + } else { + return <Fragment><FormattedNumber value={number / 1000000} maximumFractionDigits={0} />M</Fragment>; } }; diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 4c7ce9ba7..7121030d2 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -6399,13 +6399,13 @@ noscript { &__links { font-size: 14px; color: $darker-text-color; + padding: 10px 0; a { display: inline-block; color: $darker-text-color; text-decoration: none; - padding: 10px; - padding-top: 20px; + padding: 5px 10px; font-weight: 500; strong { |