diff --git a/app/Util/Lexer/PrettyNumber.php b/app/Util/Lexer/PrettyNumber.php index 4e6a4eba6..faf267016 100644 --- a/app/Util/Lexer/PrettyNumber.php +++ b/app/Util/Lexer/PrettyNumber.php @@ -4,7 +4,7 @@ namespace App\Util\Lexer; class PrettyNumber { - public static function convert($number) + public static function convert($number, $showDecimals = true) { if(!is_integer($number)) { return $number; @@ -14,7 +14,7 @@ class PrettyNumber foreach ($abbrevs as $exponent => $abbrev) { if(abs($number) >= pow(10, $exponent)) { $display = $number / pow(10, $exponent); - $decimals = ($exponent >= 3 && round($display) < 100) ? 1 : 0; + $decimals = !$showDecimals ? 0 : ($exponent >= 3 && round($display) < 100) ? 1 : 0; $number = number_format($display, $decimals).$abbrev; break; }