You are here

public function LegacyNumberFormatter::format in Price 8

Same name and namespace in other branches
  1. 3.x src/LegacyNumberFormatter.php \Drupal\price\LegacyNumberFormatter::format()
  2. 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\price

Code

public function format($number) {
  $options = [
    'currency_display' => 'none',
  ] + $this->options;
  return $this->currencyFormatter
    ->format($number, 'XXX', $options);
}