diff options
Diffstat (limited to 'apps/web/src/services/storage')
| -rw-r--r-- | apps/web/src/services/storage/quota.ts | 4 |
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> {
|
