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 b7f3ae5 commit 93b48cdCopy full SHA for 93b48cd
src/format.php
@@ -9,6 +9,6 @@ function format_bytes($bytes, $precision = 2)
9
$factor = floor(((strlen($bytes) - 1) / 3));
10
$factor = ($factor > $maxFactor) ? $maxFactor : $factor;
11
12
- return sprintf("%.{$precision}f", ($bytes / pow(1024, $factor))) . $units[$factor];
+ return round(($bytes / pow(1024, $factor)), $precision) . $units[$factor];
13
}
14
0 commit comments