No decimal points for Kilobyte and Byte #5371.
This commit is contained in:
parent
de2b444030
commit
243f3f0c4c
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue