]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix human filesize column header
authorJörn Friedrich Dreyer <jfd@butonic.de>
Tue, 6 Nov 2012 10:01:02 +0000 (11:01 +0100)
committerJörn Friedrich Dreyer <jfd@butonic.de>
Tue, 6 Nov 2012 10:08:02 +0000 (11:08 +0100)
core/js/js.js

index 2073fc4d4b7fe0355b98db14c4d67d48194b3483..87d0a172082ce0b48652c7c3724a2fb9d8d7e316 100644 (file)
@@ -649,7 +649,7 @@ $.fn.filterAttr = function(attr_name, attr_value) {
 function humanFileSize(size) {
        var humanList = ['B', 'kB', 'MB', 'GB', 'TB'];
        // Calculate Log with base 1024: size = 1024 ** order
-       var order = Math.floor(Math.log(size) / Math.log(1024));
+       var order = size?Math.floor(Math.log(size) / Math.log(1024)):0;
        // Stay in range of the byte sizes that are defined
        order = Math.min(humanList.length - 1, order);
        var readableFormat = humanList[order];