You are here

class PhysicalNumberFormatter in Price 2.0.x

Wraps the NumberFormatter for use by the Physical Fields module.

Hierarchy

Expanded class hierarchy of PhysicalNumberFormatter

See also

\Drupal\price\PriceServiceProvider

File

src/PhysicalNumberFormatter.php, line 13

Namespace

Drupal\price
View 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

Namesort descending Modifiers Type Description Overrides
PhysicalNumberFormatter::__construct public function Constructs a new PhysicalNumberFormatter object. Overrides NumberFormatter::__construct