[fix]公共函数字节转换bug修复

(cherry picked from commit 6b4cdff2e0)
pull/460/MERGE
bran 2023-08-28 08:55:53 +08:00 committed by F4nniu
parent cc9802877a
commit faff9fc96f
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ if (!function_exists('format_bytes')) {
function format_bytes($size, $delimiter = '', $precision = 2)
{
$units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB');
for ($i = 0; $size >= 1024 && $i < 6; $i++) {
for ($i = 0; $size >= 1024 && $i < 5; $i++) {
$size /= 1024;
}
return round($size, $precision) . $delimiter . $units[$i];