You are here

public function PhysicalNumberFormatter::__construct in Commerce Core 8.2

Constructs a new PhysicalNumberFormatter object.

Parameters

\CommerceGuys\Intl\NumberFormat\NumberFormatRepositoryInterface $number_format_repository: The number format repository.

\Drupal\commerce\CurrentLocaleInterface $current_locale: The current locale.

Overrides NumberFormatter::__construct

File

modules/price/src/PhysicalNumberFormatter.php, line 24

Class

PhysicalNumberFormatter
Wraps the NumberFormatter for use by the Physical Fields module.

Namespace

Drupal\commerce_price

Code

public function __construct(NumberFormatRepositoryInterface $number_format_repository, CurrentLocaleInterface $current_locale) {
  $default_options = [
    'maximum_fraction_digits' => 6,
  ];
  parent::__construct($number_format_repository, $current_locale, $default_options);
}