locale = $locale; $this->style = $style; } public function formatCurrency(float | int | string $amount, string $currency): string { $value = (float) $amount; $formatted = number_format($value, 2, '.', ','); return $currency . ' ' . $formatted; } public function format(float | int | string $number): string { $value = (float) $number; $decimals = (abs($value - (int) $value) > 0.000001) ? 2 : 0; return number_format($value, $decimals, '.', ','); } } }