class NumberFormatter in Price 8
Same name and namespace in other branches
- 3.x src/NumberFormatter.php \Drupal\price\NumberFormatter
- 2.0.x src/NumberFormatter.php \Drupal\price\NumberFormatter
- 2.x src/NumberFormatter.php \Drupal\price\NumberFormatter
- 3.0.x src/NumberFormatter.php \Drupal\price\NumberFormatter
Extends the commerceguys/intl NumberFormatter to provide better defaults.
Hierarchy
- class \Drupal\price\NumberFormatter extends \CommerceGuys\Intl\Formatter\NumberFormatter
Expanded class hierarchy of NumberFormatter
See also
\CommerceGuys\Intl\Formatter\NumberFormatterInterface
1 string reference to 'NumberFormatter'
1 service uses NumberFormatter
File
- src/
NumberFormatter.php, line 14
Namespace
Drupal\priceView source
class NumberFormatter extends ExternalNumberFormatter {
/**
* Constructs a new NumberFormatter object.
*
* @param \CommerceGuys\Intl\NumberFormat\NumberFormatRepositoryInterface $number_format_repository
* The number format repository.
* @param \Drupal\price\CurrentLocaleInterface $current_locale
* The current locale.
*/
public function __construct(NumberFormatRepositoryInterface $number_format_repository, CurrentLocaleInterface $current_locale) {
$default_options = [
'locale' => $current_locale
->getLocale()
->getLocaleCode(),
];
parent::__construct($number_format_repository, $default_options);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
NumberFormatter:: |
public | function | Constructs a new NumberFormatter object. |