Fix shortNumberFormat to within 3 chars without units (#12706)
parent
162dc845a0
commit
0e8c0287d0
|
@ -4,9 +4,13 @@ import { FormattedNumber } from 'react-intl';
|
||||||
export const shortNumberFormat = number => {
|
export const shortNumberFormat = number => {
|
||||||
if (number < 1000) {
|
if (number < 1000) {
|
||||||
return <FormattedNumber value={number} />;
|
return <FormattedNumber value={number} />;
|
||||||
} else if (number < 1000000) {
|
} else if (number < 10000) {
|
||||||
return <Fragment><FormattedNumber value={number / 1000} maximumFractionDigits={1} />K</Fragment>;
|
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>;
|
return <Fragment><FormattedNumber value={number / 1000000} maximumFractionDigits={1} />M</Fragment>;
|
||||||
|
} else {
|
||||||
|
return <Fragment><FormattedNumber value={number / 1000000} maximumFractionDigits={0} />M</Fragment>;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -6399,13 +6399,13 @@ noscript {
|
||||||
&__links {
|
&__links {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: $darker-text-color;
|
color: $darker-text-color;
|
||||||
|
padding: 10px 0;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
color: $darker-text-color;
|
color: $darker-text-color;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
padding: 10px;
|
padding: 5px 10px;
|
||||||
padding-top: 20px;
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
||||||
strong {
|
strong {
|
||||||
|
|
Reference in New Issue