Skip to content

Commit 2b26a9a

Browse files
authored
Fix Bibabyte in humanNumber (#188)
1 parent 59ca2c8 commit 2b26a9a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

benchmarks/Support/Reporter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ abstract public function finishedSubjects(Subjects $subjects, int $workers): voi
2828
*/
2929
public static function humanMemory($bytes)
3030
{
31-
$i = floor(log($bytes, 1024));
31+
$i = (int) floor(log($bytes, 1024));
3232

3333
return number_format(
3434
$bytes / pow(1024, $i),
@@ -42,12 +42,12 @@ public static function humanMemory($bytes)
4242
*/
4343
public static function humanNumber($number)
4444
{
45-
$i = $number > 0 ? floor(log($number, 1000)) : 0;
45+
$i = $number > 0 ? (int) floor(log($number, 1000)) : 0;
4646

4747
return number_format(
4848
$number / pow(1000, $i),
4949
[0, 2, 2, 2][$i],
50-
) . ['', 'K', 'M', 'B'][$i];
50+
) . ['', 'K', 'M', 'G'][$i];
5151
}
5252

5353
/**

0 commit comments

Comments
 (0)