This commit is contained in:
Flummi
2020-04-03 13:12:35 +02:00
parent d39deeb038
commit a202ae2e69
11 changed files with 297 additions and 16 deletions

5
src/inc/lib.mjs Normal file
View File

@@ -0,0 +1,5 @@
export default new class {
formatSize(size, i = ~~(Math.log(size) / Math.log(1024))) {
return (size / Math.pow(1024, i)).toFixed(2) * 1 + " " + ["B", "kB", "MB", "GB", "TB"][i];
}
};