mirror of
https://github.com/SomboChea/ui
synced 2024-09-30 13:27:48 +07:00
6 lines
202 B
JavaScript
6 lines
202 B
JavaScript
export default function fileSizeSI(a, b, c, d, e) {
|
|
return (b = Math, c = b.log, d = 1e3, e = c(a) / c(d) | 0, a / b.pow(d, e)).toFixed(2)
|
|
+ ' ' + (e ? 'kMGTPEZY'[--e] + 'B' : 'Bytes');
|
|
};
|
|
|