public function LegacyNumberFormatter::format in Price 8
Same name and namespace in other branches
- 3.x src/LegacyNumberFormatter.php \Drupal\price\LegacyNumberFormatter::format()
- 3.0.x src/LegacyNumberFormatter.php \Drupal\price\LegacyNumberFormatter::format()
Formats a number.
Parameters
string $number: The number.
Return value
string The formatted number
File
- src/
LegacyNumberFormatter.php, line 48
Class
- LegacyNumberFormatter
- Provides a legacy number formatter for the deprecated NumberFormatterFactory.
Namespace
Drupal\priceCode
public function format($number) {
$options = [
'currency_display' => 'none',
] + $this->options;
return $this->currencyFormatter
->format($number, 'XXX', $options);
}