= 1024 && $current < sizeof($units) - 1) { $current++; $currentSize /= 1024; } return number_format($currentSize, ($current == 0) ? 0 : 2).' '.$units[$current]; }