class PhysicalNumberFormatter in Price 2.0.x
Wraps the NumberFormatter for use by the Physical Fields module.
Hierarchy
- class \Drupal\price\NumberFormatter extends \CommerceGuys\Intl\Formatter\NumberFormatter
- class \Drupal\price\PhysicalNumberFormatter implements \Drupal\physical\NumberFormatterInterface
Expanded class hierarchy of PhysicalNumberFormatter
See also
\Drupal\price\PriceServiceProvider
File
- src/
PhysicalNumberFormatter.php, line 13
Namespace
Drupal\priceView source
class PhysicalNumberFormatter extends NumberFormatter implements NumberFormatterInterface {
/**
* Constructs a new PhysicalNumberFormatter 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 = [
'maximum_fraction_digits' => 6,
];
parent::__construct($number_format_repository, $current_locale, $default_options);
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PhysicalNumberFormatter:: |
public | function |
Constructs a new PhysicalNumberFormatter object. Overrides NumberFormatter:: |