Passolution
This commit is contained in:
parent
f79806ffe8
commit
06fc3ba919
31 changed files with 337 additions and 119 deletions
|
|
@ -289,5 +289,18 @@ class Util
|
|||
return $content;
|
||||
}
|
||||
|
||||
public static function _formatBytes($size, $precision = 2)
|
||||
{
|
||||
if ($size > 0) {
|
||||
$size = (int) $size;
|
||||
$base = log($size) / log(1024);
|
||||
$suffixes = array(' bytes', ' KB', ' MB', ' GB', ' TB');
|
||||
|
||||
return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];
|
||||
} else {
|
||||
return $size;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue