Convert\Byte class fix string in abs call

This commit is contained in:
Clemens Schwaighofer
2022-12-09 16:33:47 +09:00
parent 1e0dfa2106
commit 9936fc04da

View File

@@ -65,7 +65,7 @@ class Byte
// si or normal
$unit = $si ? 1000 : 1024;
// always positive
$abs_bytes = $bytes == PHP_INT_MIN ? PHP_INT_MAX : abs($bytes);
$abs_bytes = $bytes == PHP_INT_MIN ? PHP_INT_MAX : abs((float)$bytes);
// smaller than unit is always B
if ($abs_bytes < $unit) {
return $bytes . 'B';