public function __construct(private readonly LanguageLocaleCodeProvider
$languageLocaleProvider) { } /**
* @throws InconsistentCriteriaIdsException
* @throws LanguageNotFoundException
*/
public function formatCurrencyByLanguage(float
$price, string
$currency, string
$languageId, Context
$context, ?int
$decimals = null
): string
{ $decimals ??=
$context->
getRounding()->
getDecimals();
$formatter =
$this->
getFormatter( $this->languageLocaleProvider->
getLocaleForLanguageId($languageId) );
$formatter->
setAttribute(\NumberFormatter::FRACTION_DIGITS,
$decimals);
return (string) $formatter->
formatCurrency($price,
$currency);
} public function reset(): void
{