Skip to content

Commit 7ddc96f

Browse files
authored
Update Byte.php
1 parent c221a14 commit 7ddc96f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Byte.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,10 @@ public function greaterThan(int|float|string $operand): bool
264264
*/
265265
public static function humanize(int|float $bytes, int $precision = 2, string $delim = ' '): string
266266
{
267-
foreach (self::units as $exponent => $unit) {
267+
foreach (self::units as $unit => $exponent) {
268268
if (($result = $bytes / pow(self::amount, $exponent)) < 1) continue;
269269
if ($precision) $result = round($result, $precision);
270-
return "$result$delim".self::units[$exponent];
270+
return "$result$delim$unit";
271271
}
272272
}
273273

0 commit comments

Comments
 (0)