about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-08-13 12:22:33 +0200
committerGitHub <noreply@github.com>2019-08-13 12:22:33 +0200
commit0e9668051e58b2ff4e48b82fa7cc17d385c7a5c9 (patch)
treeaf1b5b9ccceb0c3dcb38e18ffdf4f44b3c43c8be
parentc09ecbc53eb3d3a8a1e2a1e61e20c9e5dbd4f560 (diff)
Fix short number formatting for numbers above million in web UI (#11559)
-rw-r--r--app/javascript/mastodon/utils/numbers.js4
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>;
   }
 };