GODT-1351: Cache and update of space bytes in user object.

This commit is contained in:
Jakub
2021-09-21 14:54:15 +02:00
parent 41e15db442
commit 2899e7bb15
27 changed files with 243 additions and 49 deletions

View File

@ -42,7 +42,7 @@ Item {
function spaceWithUnits(bytes){
if (bytes*1 !== bytes ) return "0 kB"
var units = ['B',"kB", "MB", "TB"];
var units = ['B',"kB", "MB", "GB", "TB"];
var i = parseInt(Math.floor(Math.log(bytes)/Math.log(1024)));
return Math.round(bytes*10 / Math.pow(1024, i))/10 + " " + units[i]