You are here

public function LegacyNumberFormatter::parse in Price 3.0.x

Same name and namespace in other branches
  1. 8 src/LegacyNumberFormatter.php \Drupal\price\LegacyNumberFormatter::parse()
  2. 3.x src/LegacyNumberFormatter.php \Drupal\price\LegacyNumberFormatter::parse()

Parses a formatted number.

Parameters

string $number: The formatted number.

Return value

string|false The parsed number, or FALSE on failure.

File

src/LegacyNumberFormatter.php, line 77

Class

LegacyNumberFormatter
Provides a legacy number formatter for the deprecated NumberFormatterFactory.

Namespace

Drupal\price

Code

public function parse($number) {
  return $this->currencyFormatter
    ->parse($number, 'XXX');
}