mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +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;
|
return $number;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function size($expression, $kb = false)
|
public static function size($expression, $kb = false, $short = true)
|
||||||
{
|
{
|
||||||
if ($kb) {
|
if ($kb) {
|
||||||
$expression = $expression * 1024;
|
$expression = $expression * 1024;
|
||||||
}
|
}
|
||||||
$size = intval($expression);
|
$size = intval($expression);
|
||||||
$precision = 0;
|
$precision = 0;
|
||||||
$short = true;
|
|
||||||
$units = $short ?
|
$units = $short ?
|
||||||
['B', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'] :
|
['B', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'] :
|
||||||
['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||||
|
|
Loading…
Reference in a new issue