Display normal number up to 9999

I find 1.15K to be extremely hard to read and it takes the same amount of characters as 1150.
This commit is contained in:
Johan LAJILI 2023-06-27 16:26:57 +01:00 committed by GitHub
parent 934cabcec4
commit bb3d386e4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,5 +6,8 @@ const SHORTNUM_SI_FORMAT = new Intl.NumberFormat("en-US", {
});
export default function numToSI(value: number): string {
if (value < 10000) {
return value.toString()
}
return SHORTNUM_SI_FORMAT.format(value);
}