You are here

public function NumberFormatterInterface::format in Physical Fields 8

Formats the given number for the current language.

Supported options:

  • use_grouping: Whether to use grouping separators, such as thousands separators. Default: true.
  • minimum_fraction_digits: Minimum fraction digits. Default: 0.
  • maximum_fraction_digits: Minimum fraction digits. Default: 6.

Parameters

string $number: The number.

array $options: The formatting options.

Return value

string The formatted number.

1 method overrides NumberFormatterInterface::format()
NumberFormatter::format in src/NumberFormatter.php
Formats the given number for the current language.

File

src/NumberFormatterInterface.php, line 31

Class

NumberFormatterInterface
Allows parsing and formatting numbers using language-specific rules.

Namespace

Drupal\physical

Code

public function format($number, array $options = []);