summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/js/js.js5
-rw-r--r--lib/private/helper.php2
2 files changed, 5 insertions, 2 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 3650d0520a7..f380234af05 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -836,7 +836,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";
}