mirror of
https://github.com/tuna/mirror-web.git
synced 2025-12-25 20:32:46 +00:00
parent
6f495bff6a
commit
e1b074082a
11
index.php
11
index.php
|
|
@ -145,16 +145,7 @@ function initialize_status($status_file, $ftp3_status_file)
|
|||
|
||||
function format_size($size)
|
||||
{
|
||||
$size = explode(' ', $size);
|
||||
if ($size[0] === 'na') {
|
||||
return 'na';
|
||||
}
|
||||
$size = (float)$size[0];
|
||||
$size /= 1048576;
|
||||
if ($size <= 1000)
|
||||
return sprintf("%.2f MB", $size);
|
||||
$size /= 1024;
|
||||
return sprintf("%.2f GB", $size);
|
||||
return str_replace(' bytes', 'B', $size);
|
||||
}
|
||||
?>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue