]> cat aescling's git repositories - mastodon.git/commitdiff
Fix shortNumberFormat to within 3 chars without units (#12706)
authorTakeshi Umeda <noel.yoshiba@gmail.com>
Sun, 29 Dec 2019 15:59:25 +0000 (00:59 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Sun, 29 Dec 2019 15:59:25 +0000 (16:59 +0100)
app/javascript/mastodon/utils/numbers.js
app/javascript/styles/mastodon/components.scss

index f7e4ceb9354e50ca340f3a20ca7750de1acb76aa..af18dcfddb2a80cb552206d553938a03d9a53d4b 100644 (file)
@@ -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>;
   }
 };
index 4c7ce9ba7c389966b97b2c9668232d31b3bfea8e..7121030d24943a624acba4fa9557648e52009457 100644 (file)
@@ -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 {