summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2014-01-05 11:52:10 -0800
committerMorris Jobke <morris.jobke@gmail.com>2014-01-05 11:52:10 -0800
commitce3df4469909852ddaa1b35addd4c0e8a9a68195 (patch)
tree65dce73e25816062e1e684a11c5657174cea586e
parente2d739fa21817c8442304e69a3fd70454def0aa7 (diff)
parent8fdc4585f7545a95ac404af03179cf79452df1c9 (diff)
downloadnextcloud-server-ce3df4469909852ddaa1b35addd4c0e8a9a68195.tar.gz
nextcloud-server-ce3df4469909852ddaa1b35addd4c0e8a9a68195.zip
Merge pull request #6031 from s0taka/master
No decimal points for Kilobyte and Byte #5371.
-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";
}