No decimal points for Kilobyte and Byte #5371.

This commit is contained in:
Simon Könnecke 2013-11-25 12:26:03 +01:00
parent de2b444030
commit 243f3f0c4c
2 changed files with 5 additions and 2 deletions

View File

@ -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;

View File

@ -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";
}