@@ -74,12 +74,15 @@ |
||
| 74 | 74 | * @return string |
| 75 | 75 | */ |
| 76 | 76 | function humanFileSize($size,$unit="") { |
| 77 | - if( (!$unit && $size >= 1<<30) || $unit == "GB") |
|
| 78 | - return number_format($size/(1<<30),2)."GB"; |
|
| 79 | - if( (!$unit && $size >= 1<<20) || $unit == "MB") |
|
| 80 | - return number_format($size/(1<<20),2)."MB"; |
|
| 81 | - if( (!$unit && $size >= 1<<10) || $unit == "KB") |
|
| 82 | - return number_format($size/(1<<10),2)."KB"; |
|
| 77 | + if( (!$unit && $size >= 1<<30) || $unit == "GB") { |
|
| 78 | + return number_format($size/(1<<30),2)."GB"; |
|
| 79 | + } |
|
| 80 | + if( (!$unit && $size >= 1<<20) || $unit == "MB") { |
|
| 81 | + return number_format($size/(1<<20),2)."MB"; |
|
| 82 | + } |
|
| 83 | + if( (!$unit && $size >= 1<<10) || $unit == "KB") { |
|
| 84 | + return number_format($size/(1<<10),2)."KB"; |
|
| 85 | + } |
|
| 83 | 86 | return number_format($size)." bytes"; |
| 84 | 87 | } |
| 85 | 88 | |