mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
refactor: clean up number formatting and step handling in property tabs
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user