mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update PrettyNumber util
This commit is contained in:
parent
cd78560184
commit
0932b6e117
1 changed files with 1 additions and 2 deletions
|
@ -24,14 +24,13 @@ class PrettyNumber
|
|||
return $number;
|
||||
}
|
||||
|
||||
public static function size($expression, $kb = false)
|
||||
public static function size($expression, $kb = false, $short = true)
|
||||
{
|
||||
if ($kb) {
|
||||
$expression = $expression * 1024;
|
||||
}
|
||||
$size = intval($expression);
|
||||
$precision = 0;
|
||||
$short = true;
|
||||
$units = $short ?
|
||||
['B', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'] :
|
||||
['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
|
|
Loading…
Reference in a new issue