From c34e01c63eea9fb97d8d4e93546d884b0294e475 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Fri, 27 Mar 2026 21:24:59 +0100 Subject: refactor: clean up number formatting and step handling in property tabs --- apps/web/src/services/storage/quota.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apps/web/src/services/storage') 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 { -- cgit v1.3.1