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
|
@ -1,16 +1,9 @@
|
|||
import React from 'react';
|
||||
import { Sparklines, SparklinesCurve } from 'react-sparklines';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { FormattedMessage, FormattedNumber } from 'react-intl';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
|
||||
const shortNumberFormat = number => {
|
||||
if (number < 1000) {
|
||||
return <FormattedNumber value={number} />;
|
||||
} else {
|
||||
return <React.Fragment><FormattedNumber value={number / 1000} maximumFractionDigits={1} />K</React.Fragment>;
|
||||
}
|
||||
};
|
||||
import { shortNumberFormat } from '../utils/numbers';
|
||||
|
||||
const Hashtag = ({ hashtag }) => (
|
||||
<div className='trends__item'>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue