public function NumberFormatter::__construct in Price 8
Same name and namespace in other branches
- 3.x src/NumberFormatter.php \Drupal\price\NumberFormatter::__construct()
- 2.0.x src/NumberFormatter.php \Drupal\price\NumberFormatter::__construct()
- 2.x src/NumberFormatter.php \Drupal\price\NumberFormatter::__construct()
- 3.0.x src/NumberFormatter.php \Drupal\price\NumberFormatter::__construct()
Constructs a new NumberFormatter object.
Parameters
\CommerceGuys\Intl\NumberFormat\NumberFormatRepositoryInterface $number_format_repository: The number format repository.
\Drupal\price\CurrentLocaleInterface $current_locale: The current locale.
File
- src/
NumberFormatter.php, line 24
Class
- NumberFormatter
- Extends the commerceguys/intl NumberFormatter to provide better defaults.
Namespace
Drupal\priceCode
public function __construct(NumberFormatRepositoryInterface $number_format_repository, CurrentLocaleInterface $current_locale) {
$default_options = [
'locale' => $current_locale
->getLocale()
->getLocaleCode(),
];
parent::__construct($number_format_repository, $default_options);
}