Changeset 154 for trunk/lib/Utilities.inc.php
- Timestamp:
- Jun 8, 2006 5:36:10 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Utilities.inc.php
r136 r154 250 250 * @version 1.1.0 251 251 */ 252 function humanFileSize($size, $ unit=null, $format='%01.2f %s')252 function humanFileSize($size, $max_unit=null, $format='%01.2f %s') 253 253 { 254 254 // Units … … 257 257 258 258 // Max unit 259 $ unit = array_search((string) $unit, $units);260 if ($ unit === null || $unit === false) {261 $ unit = $ii;259 $max_unit = array_search((string) $max_unit, $units); 260 if ($max_unit === null || $max_unit === false) { 261 $max_unit = $ii; 262 262 } 263 263 264 264 // Loop 265 265 $i = 0; 266 while ($ unit != $i && $size >= 1024 && $i < $ii) {266 while ($max_unit != $i && $size >= 1024 && $i < $ii) { 267 267 $size /= 1024; 268 268 $i++;
Note: See TracChangeset
for help on using the changeset viewer.