summaryrefslogtreecommitdiffstats
path: root/core
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 /core
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.
Diffstat (limited to 'core')
-rw-r--r--core/js/js.js5
1 files changed, 4 insertions, 1 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;