Fixed bug with rankings display.

This commit is contained in:
Mike Cao 2020-08-19 23:30:31 -07:00
parent b905824d50
commit d95e149cf6
3 changed files with 8 additions and 5 deletions

View file

@ -44,7 +44,9 @@ export function formatNumber(n) {
return Number(n).toFixed(0);
}
export function formatLongNumber(n) {
export function formatLongNumber(value) {
const n = Number(value);
if (n >= 1000000) {
return `${(n / 1000000).toFixed(1)}m`;
}
@ -57,5 +59,6 @@ export function formatLongNumber(n) {
if (n >= 1000) {
return `${(n / 1000).toFixed(2)}k`;
}
return formatNumber(n);
}