This commit is contained in:
Flummi
2018-09-02 18:17:30 +02:00
parent bfb9fa79de
commit e62de626b4
7 changed files with 84 additions and 96 deletions

View File

@@ -24,7 +24,7 @@ const checkRepostCheckSum = (cs, cbcrcs) => {
cbcrcs((rows[0].count == 0)?true:rows[0].id);
});
};
const formatSize = (size) => {
const formatSize = size => {
const i = ~~(Math.log(size) / Math.log(1024));
return (size / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i];
};