diff options
author | Simon Könnecke <simonkoennecke@gmail.com> | 2013-11-25 12:26:03 +0100 |
---|---|---|
committer | Simon Könnecke <simonkoennecke@gmail.com> | 2013-11-25 12:26:03 +0100 |
commit | 243f3f0c4c2831f4cf27c33f1d4cc748843d24da (patch) | |
tree | edf7a6351533013aaded0c2b2e3fe8f9375c9f37 /core/js/js.js | |
parent | de2b4440301badf48e638ede84f64692f2a2db41 (diff) | |
download | nextcloud-server-243f3f0c4c2831f4cf27c33f1d4cc748843d24da.tar.gz nextcloud-server-243f3f0c4c2831f4cf27c33f1d4cc748843d24da.zip |
No decimal points for Kilobyte and Byte #5371.
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/js/js.js b/core/js/js.js index f5991cfc9dd..b838e9578e7 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -825,7 +825,10 @@ function humanFileSize(size) { order = Math.min(humanList.length - 1, order); var readableFormat = humanList[order]; var relativeSize = (size / Math.pow(1024, order)).toFixed(1); - if(relativeSize.substr(relativeSize.length-2,2)=='.0'){ + if(order < 2){ + relativeSize = parseFloat(relativeSize).toFixed(0); + } + else if(relativeSize.substr(relativeSize.length-2,2)==='.0'){ relativeSize=relativeSize.substr(0,relativeSize.length-2); } return relativeSize + ' ' + readableFormat; |