Display numbers in account header using shortNumberFormat for consistency (#7723)
This commit is contained in:
parent
5bf5003384
commit
1bbe81030c
3 changed files with 17 additions and 13 deletions
10
app/javascript/mastodon/utils/numbers.js
Normal file
10
app/javascript/mastodon/utils/numbers.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
import React, { Fragment } from 'react';
|
||||
import { FormattedNumber } from 'react-intl';
|
||||
|
||||
export const shortNumberFormat = number => {
|
||||
if (number < 1000) {
|
||||
return <FormattedNumber value={number} />;
|
||||
} else {
|
||||
return <Fragment><FormattedNumber value={number / 1000} maximumFractionDigits={1} />K</Fragment>;
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue