summaryrefslogtreecommitdiffstats
path: root/core/js/js.js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-02-12 18:34:54 +0100
committerLukas Reschke <lukas@owncloud.com>2015-02-12 18:34:54 +0100
commitdfcd4acd5aebfa3476c58c652bbf5545d3882217 (patch)
treecd16206197177000bc9ed776fbe63f2e18bdba36 /core/js/js.js
parentbd5440a8a38e7960a382866a233ed313663fe50f (diff)
parentccc1f096273b81ba29ef2dfbfad6baaf7ecd0082 (diff)
downloadnextcloud-server-dfcd4acd5aebfa3476c58c652bbf5545d3882217.tar.gz
nextcloud-server-dfcd4acd5aebfa3476c58c652bbf5545d3882217.zip
Merge pull request #13771 from owncloud/fix-humanfileSize
generate valid human readable text for 0
Diffstat (limited to 'core/js/js.js')
-rw-r--r--core/js/js.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 808c2c28adf..7ff010eca0a 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -1213,7 +1213,7 @@ $.fn.filterAttr = function(attr_name, attr_value) {
function humanFileSize(size, skipSmallSizes) {
var humanList = ['B', 'kB', 'MB', 'GB', 'TB'];
// Calculate Log with base 1024: size = 1024 ** order
- var order = size?Math.floor(Math.log(size) / Math.log(1024)):0;
+ var order = size > 0 ? 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];