An electron-based WIP aesthetic file explorer ^^
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
module.exports = function getsize(bytes) {
|
|
let val = bytes;
|
|
let types = ['Bytes', 'Kilobytes', 'Megabytes', 'Gigabytes', 'Terabytes'];
|
|
reit = 0;
|
|
while (true) {
|
|
if (val > 1000) {
|
|
val = (val / 1024).toFixed(2);
|
|
reit++;
|
|
} else {break;}
|
|
}
|
|
return `${val} ${types[reit]}`;
|
|
}; |