mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-19 19:31:54 +03:00
16 lines
314 B
JavaScript
16 lines
314 B
JavaScript
export const makeCountFriendly = value => {
|
|
if (!value) {
|
|
return value;
|
|
}
|
|
if (value >= 1000000) {
|
|
return `${intlFormat(value / 1000000)}M`;
|
|
}
|
|
if (value >= 1000) {
|
|
return `${intlFormat(value / 1000)}K`;
|
|
}
|
|
|
|
return intlFormat(value);
|
|
};
|
|
|
|
const intlFormat = num => Math.round(num * 10) / 10;
|