mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Display GB and TB sizes correctly in FileHandler::filesize()
This commit is contained in:
parent
7bf5d78206
commit
4f15ae24ea
1 changed files with 12 additions and 2 deletions
|
|
@ -256,12 +256,22 @@ class FileHandler
|
|||
return $size . 'Bytes';
|
||||
}
|
||||
|
||||
if($size >= 1024 && $size < 1024 * 1024)
|
||||
if($size >= 1024 && $size < (1024 * 1024))
|
||||
{
|
||||
return sprintf("%0.1fKB", $size / 1024);
|
||||
}
|
||||
|
||||
return sprintf("%0.2fMB", $size / (1024 * 1024));
|
||||
if($size >= (1024 * 1024) && $size < (1024 * 1024 * 1024))
|
||||
{
|
||||
return sprintf("%0.2fMB", $size / (1024 * 1024));
|
||||
}
|
||||
|
||||
if($size >= (1024 * 1024 * 1024) && $size < (1024 * 1024 * 1024 * 1024))
|
||||
{
|
||||
return sprintf("%0.2fGB", $size / (1024 * 1024 * 1024));
|
||||
}
|
||||
|
||||
return sprintf("%0.2fTB", $size / (1024 * 1024 * 1024 * 1024));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue