fix: number format

This commit is contained in:
Alejandro Gomez 2023-02-03 22:59:35 +01:00
parent d0bc7f83fb
commit a134086807
No known key found for this signature in database
GPG Key ID: 4DF39E566658C817

View File

@ -7,8 +7,8 @@ export function formatShort(n: number) {
if (n < 999) { if (n < 999) {
return n return n
} else if (n < 1e8) { } else if (n < 1e8) {
return `${intl.format(Math.floor(n / 1e3))}K` return `${intl.format(n / 1e3)}K`
} else { } else {
return `${intl.format(Math.floor(n / 1e6))}M` return `${intl.format(n / 1e6)}M`
} }
} }