mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
return byte's'
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9857 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
634b2c4e6c
commit
99e196cd48
1 changed files with 4 additions and 2 deletions
|
|
@ -321,8 +321,9 @@ class FileHandler {
|
|||
* @return file size string
|
||||
**/
|
||||
function filesize($size) {
|
||||
if(!$size) return "0Byte";
|
||||
if($size < 1024) return ($size."Byte");
|
||||
if(!$size) return '0Byte';
|
||||
if($size === 1) return '1Byte';
|
||||
if($size < 1024) return $size.'Bytes';
|
||||
if($size >= 1024 && $size < 1024*1024) return sprintf("%0.1fKB",$size / 1024);
|
||||
return sprintf("%0.2fMB",$size / (1024*1024));
|
||||
}
|
||||
|
|
@ -426,6 +427,7 @@ class FileHandler {
|
|||
if($last == 'g') $val *= 1024*1024*1024;
|
||||
else if($last == 'm') $val *= 1024*1024;
|
||||
else if($last == 'k') $val *= 1024;
|
||||
else $val *= 1;
|
||||
|
||||
return $val;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue