about summary refs log tree commit diff
path: root/src/view/com/util/numeric/format.ts
diff options
context:
space:
mode:
authorOllie H <renahlee@outlook.com>2023-05-01 11:31:00 -0700
committerGitHub <noreply@github.com>2023-05-01 13:31:00 -0500
commit0ec98c77ef65ff74e83b314d8eed9ef9b07d47d3 (patch)
tree744eaf6c0761499e3b1321e874a80c63d3194fc5 /src/view/com/util/numeric/format.ts
parent7171d0404ed61fbfb6d593aae3030834ad885072 (diff)
downloadvoidsky-0ec98c77ef65ff74e83b314d8eed9ef9b07d47d3.tar.zst
Format large numbers (#556)
Diffstat (limited to 'src/view/com/util/numeric/format.ts')
-rw-r--r--src/view/com/util/numeric/format.ts5
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)