diff options
author | Ollie H <renahlee@outlook.com> | 2023-05-01 11:31:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-01 13:31:00 -0500 |
commit | 0ec98c77ef65ff74e83b314d8eed9ef9b07d47d3 (patch) | |
tree | 744eaf6c0761499e3b1321e874a80c63d3194fc5 /src/view/com/util/numeric | |
parent | 7171d0404ed61fbfb6d593aae3030834ad885072 (diff) | |
download | voidsky-0ec98c77ef65ff74e83b314d8eed9ef9b07d47d3.tar.zst |
Format large numbers (#556)
Diffstat (limited to 'src/view/com/util/numeric')
-rw-r--r-- | src/view/com/util/numeric/format.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/view/com/util/numeric/format.ts b/src/view/com/util/numeric/format.ts new file mode 100644 index 000000000..f0e90217f --- /dev/null +++ b/src/view/com/util/numeric/format.ts @@ -0,0 +1,5 @@ +export const formatCount = (num: number) => + Intl.NumberFormat('en-US', { + notation: 'compact', + maximumFractionDigits: 1, + }).format(num) |