summaryrefslogtreecommitdiff
path: root/apps/web/src/services/storage/quota.ts
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-03-27 21:24:59 +0100
committerMaze Winther <mazewinther@gmail.com>2026-03-29 15:58:46 +0200
commitc34e01c63eea9fb97d8d4e93546d884b0294e475 (patch)
tree078c5e28d93bc7c4dc6a6a4818d14a67713192aa /apps/web/src/services/storage/quota.ts
parent3e75852ffee06ec75006c787389870107395bd2d (diff)
downloadopencut-c34e01c63eea9fb97d8d4e93546d884b0294e475.tar.gz
refactor: clean up number formatting and step handling in property tabs
Diffstat (limited to 'apps/web/src/services/storage/quota.ts')
-rw-r--r--apps/web/src/services/storage/quota.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/web/src/services/storage/quota.ts b/apps/web/src/services/storage/quota.ts
index 4d1adad5..2bdf303a 100644
--- a/apps/web/src/services/storage/quota.ts
+++ b/apps/web/src/services/storage/quota.ts
@@ -1,3 +1,5 @@
+import { formatNumberForDisplay } from "@/utils/math";
+
const BYTE_UNITS = ["B", "KB", "MB", "GB", "TB"] as const;
export const STORAGE_HEADROOM_RESERVE_BYTES = 50 * 1024 * 1024;
@@ -37,7 +39,7 @@ export function formatStorageBytes({ bytes }: { bytes: number }): string {
}
const precision = value >= 10 || unitIndex === 0 ? 0 : 1;
- return `${value.toFixed(precision)} ${BYTE_UNITS[unitIndex]}`;
+ return `${formatNumberForDisplay({ value, fractionDigits: precision })} ${BYTE_UNITS[unitIndex]}`;
}
export async function readStorageQuotaStatus(): Promise<StorageQuotaStatus> {