fix not displaying nonzero share sizes

This commit is contained in:
mappu 2017-02-08 19:02:20 +13:00
parent 7894355647
commit 7f618db70a

View File

@ -46,8 +46,8 @@ var fmtBytes = function(b) {
var k = 1024;
var sizes = [' B', ' KiB', ' MiB', ' GiB', ' TiB'];
var i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(3)) + sizes[i];
var i = Math.floor(Math.log(b) / Math.log(k));
return parseFloat((b / Math.pow(k, i)).toFixed(3)) + sizes[i];
};