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 | |
parent | de2b4440301badf48e638ede84f64692f2a2db41 (diff) | |
download | nextcloud-server-243f3f0c4c2831f4cf27c33f1d4cc748843d24da.tar.gz nextcloud-server-243f3f0c4c2831f4cf27c33f1d4cc748843d24da.zip |
No decimal points for Kilobyte and Byte #5371.
-rw-r--r-- | core/js/js.js | 5 | ||||
-rw-r--r-- | lib/private/helper.php | 2 |
2 files changed, 5 insertions, 2 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; diff --git a/lib/private/helper.php b/lib/private/helper.php index c82d3bd4ef4..4fe3097af26 100644 --- a/lib/private/helper.php +++ b/lib/private/helper.php @@ -252,7 +252,7 @@ class OC_Helper { if ($bytes < 1024) { return "$bytes B"; } - $bytes = round($bytes / 1024, 1); + $bytes = round($bytes / 1024, 0); if ($bytes < 1024) { return "$bytes kB"; } |