We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c221a14 commit 7ddc96fCopy full SHA for 7ddc96f
src/Byte.php
@@ -264,10 +264,10 @@ public function greaterThan(int|float|string $operand): bool
264
*/
265
public static function humanize(int|float $bytes, int $precision = 2, string $delim = ' '): string
266
{
267
- foreach (self::units as $exponent => $unit) {
+ foreach (self::units as $unit => $exponent) {
268
if (($result = $bytes / pow(self::amount, $exponent)) < 1) continue;
269
if ($precision) $result = round($result, $precision);
270
- return "$result$delim".self::units[$exponent];
+ return "$result$delim$unit";
271
}
272
273
0 commit comments