fix(tailshare): non-SI units

This commit is contained in:
2026-06-27 00:27:45 +00:00
parent 89d2bce7a0
commit 1356495932
+3 -3
View File
@@ -1,6 +1,6 @@
export function fmtSize(size: number): string {
if (size < 1024) return `${size} bytes`
if (size < 1024 * 1024) return `${Math.floor((size / 1024) * 10) / 10} kB`
if (size < 1024 * 1024 * 1024) return `${Math.floor((size / 1024 / 1024) * 10) / 10} MB`
return `${Math.floor((size / 1024 / 1024 / 1024) * 10) / 10} GB`
if (size < 1024 * 1024) return `${Math.floor((size / 1024) * 10) / 10} KiB`
if (size < 1024 * 1024 * 1024) return `${Math.floor((size / 1024 / 1024) * 10) / 10} MiB`
return `${Math.floor((size / 1024 / 1024 / 1024) * 10) / 10} GiB`
}