| @@ 77-88 (lines=12) @@ | ||
| 74 | * |
|
| 75 | * @return string |
|
| 76 | */ |
|
| 77 | private function formatBytes($bytes) |
|
| 78 | { |
|
| 79 | $bytes = (int) $bytes; |
|
| 80 | ||
| 81 | if ($bytes > 1024*1024) { |
|
| 82 | return round($bytes/1024/1024, 2).'MB'; |
|
| 83 | } elseif ($bytes > 1024) { |
|
| 84 | return round($bytes/1024, 2).'KB'; |
|
| 85 | } |
|
| 86 | ||
| 87 | return $bytes . 'B'; |
|
| 88 | } |
|
| 89 | } |
|
| 90 | ||
| @@ 236-247 (lines=12) @@ | ||
| 233 | * |
|
| 234 | * @return string |
|
| 235 | */ |
|
| 236 | private function formatBytes($bytes) |
|
| 237 | { |
|
| 238 | $bytes = (int) $bytes; |
|
| 239 | ||
| 240 | if ($bytes > 1024*1024) { |
|
| 241 | return round($bytes/1024/1024, 2).'MB'; |
|
| 242 | } elseif ($bytes > 1024) { |
|
| 243 | return round($bytes/1024, 2).'KB'; |
|
| 244 | } |
|
| 245 | ||
| 246 | return $bytes . 'B'; |
|
| 247 | } |
|
| 248 | } |
|
| 249 | ||