diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-04-11 11:00:30 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-04-11 11:00:30 +0000 |
| commit | e2a6a198729bea1477a3a3b4f19aaf65cb9042e6 (patch) | |
| tree | 2920224c60b58ee26788bfdc2d532c361bb69828 /roundcubemail/program/include | |
| parent | b88c35f24b76ffe1f1adba5dc75934a685d7023d (diff) | |
- Fix so 1024 bytes is displayed as 1KB, the same for MB and GB
git-svn-id: https://svn.roundcube.net/trunk@4640 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
| -rw-r--r-- | roundcubemail/program/include/rcube_shared.inc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/roundcubemail/program/include/rcube_shared.inc b/roundcubemail/program/include/rcube_shared.inc index 8ed56d1de..1fd6ed035 100644 --- a/roundcubemail/program/include/rcube_shared.inc +++ b/roundcubemail/program/include/rcube_shared.inc @@ -180,7 +180,7 @@ function parse_bytes($str) return floatval($bytes); } - + /** * Create a human readable string for a number of bytes * @@ -189,17 +189,17 @@ function parse_bytes($str) */ function show_bytes($bytes) { - if ($bytes > 1073741824) + if ($bytes >= 1073741824) { $gb = $bytes/1073741824; $str = sprintf($gb>=10 ? "%d " : "%.1f ", $gb) . rcube_label('GB'); } - else if ($bytes > 1048576) + else if ($bytes >= 1048576) { $mb = $bytes/1048576; $str = sprintf($mb>=10 ? "%d " : "%.1f ", $mb) . rcube_label('MB'); } - else if ($bytes > 1024) + else if ($bytes >= 1024) $str = sprintf("%d ", round($bytes/1024)) . rcube_label('KB'); else $str = sprintf('%d ', $bytes) . rcube_label('B'); @@ -207,7 +207,6 @@ function show_bytes($bytes) return $str; } - /** * Convert paths like ../xxx to an absolute path using a base url * |
