Ignore:
Timestamp:
Jun 8, 2006 5:36:10 AM (18 years ago)
Author:
scdev
Message:

${1}

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Utilities.inc.php

    r136 r154  
    250250 * @version     1.1.0
    251251 */
    252 function humanFileSize($size, $unit=null, $format='%01.2f %s')
     252function humanFileSize($size, $max_unit=null, $format='%01.2f %s')
    253253{
    254254    // Units
     
    257257
    258258    // 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;
    262262    }
    263263
    264264    // Loop
    265265    $i = 0;
    266     while ($unit != $i && $size >= 1024 && $i < $ii) {
     266    while ($max_unit != $i && $size >= 1024 && $i < $ii) {
    267267        $size /= 1024;
    268268        $i++;
Note: See TracChangeset for help on using the changeset viewer.