diff --git a/client/dcwebui.js b/client/dcwebui.js index b161f49..2dbeee4 100644 --- a/client/dcwebui.js +++ b/client/dcwebui.js @@ -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]; };