fix(tailshare): non-SI units
This commit is contained in:
@@ -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`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user