public function LegacyNumberFormatter::formatCurrency in Commerce Core 8.2
Formats a currency amount.
Parameters
string $number: The number.
\Drupal\commerce_price\Entity\CurrencyInterface $currency: The currency.
Return value
string The formatted currency amount.
File
- modules/
price/ src/ LegacyNumberFormatter.php, line 64
Class
- LegacyNumberFormatter
- Provides a legacy number formatter for the deprecated NumberFormatterFactory.
Namespace
Drupal\commerce_priceCode
public function formatCurrency($number, CurrencyInterface $currency) {
return $this->currencyFormatter
->format($number, $currency
->id(), $this->options);
}