Morris Jobke 2016-01-19 10:37:20 +01:00
parent 80fa6d5731
commit 930555bd5e
2 changed files with 3 additions and 3 deletions

View File

@ -112,7 +112,7 @@ class OC_Helper {
} }
$bytes = round($bytes / 1024, 0); $bytes = round($bytes / 1024, 0);
if ($bytes < 1024) { if ($bytes < 1024) {
return "$bytes kB"; return "$bytes KB";
} }
$bytes = round($bytes / 1024, 1); $bytes = round($bytes / 1024, 1);
if ($bytes < 1024) { if ($bytes < 1024) {

View File

@ -21,7 +21,7 @@ class Test_Helper extends \Test\TestCase {
{ {
return array( return array(
array('0 B', 0), array('0 B', 0),
array('1 kB', 1024), array('1 KB', 1024),
array('9.5 MB', 10000000), array('9.5 MB', 10000000),
array('1.3 GB', 1395864371), array('1.3 GB', 1395864371),
array('465.7 GB', 500000000000), array('465.7 GB', 500000000000),
@ -63,7 +63,7 @@ class Test_Helper extends \Test\TestCase {
function providesComputerFileSize(){ function providesComputerFileSize(){
return [ return [
[0.0, "0 B"], [0.0, "0 B"],
[1024.0, "1 kB"], [1024.0, "1 KB"],
[1395864371.0, '1.3 GB'], [1395864371.0, '1.3 GB'],
[9961472.0, "9.5 MB"], [9961472.0, "9.5 MB"],
[500041567437.0, "465.7 GB"], [500041567437.0, "465.7 GB"],