Compare commits
1 Commits
sentry
...
precise-un
Author | SHA1 | Date | |
---|---|---|---|
cd4e9fd107 |
@ -19,11 +19,11 @@ function clamp(v, min, max) {
|
||||
return v;
|
||||
}
|
||||
|
||||
const suffix = ['B', 'KB', 'MB'];
|
||||
const suffix = ['B', 'KiB', 'MiB'];
|
||||
function prettyPrintSize(size) {
|
||||
const base = Math.floor(Math.log2(size) / 10);
|
||||
const index = clamp(base, 0, 2);
|
||||
return (size / 2 ** (10 * index)).toFixed(2) + suffix[index];
|
||||
return (size / 2 ** (10 * index)).toFixed(2) + ' ' + suffix[index];
|
||||
}
|
||||
|
||||
async function decodeFile(file) {
|
||||
|
Reference in New Issue
Block a user