diff --git a/app/src/Service/Format.php b/app/src/Service/Format.php index 69bde98..4e6d4f8 100644 --- a/app/src/Service/Format.php +++ b/app/src/Service/Format.php @@ -21,9 +21,9 @@ class Format { return number_format($number, $decimal_places, ',', '.'); } - public function percent(float|string $number, int $decimal_places = 2): string + public function percent(float|string $number, int $decimal_places = 2, bool $multiply = false): string { - return "{$this->number($number, $decimal_places)}%"; + return "{$this->number(($multiply) ? $number * 100 : $number, $decimal_places)}%"; } public function pesos(string $valor, int $decimal_places = 0): string {