You are here

protected function DecimalFormatter::numberFormat in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/DecimalFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\DecimalFormatter::numberFormat()

Formats a number.

Parameters

mixed $number: The numeric value.

Return value

string The formatted number.

Overrides NumericFormatterBase::numberFormat

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/DecimalFormatter.php, line 66

Class

DecimalFormatter
Plugin implementation of the 'number_decimal' formatter.

Namespace

Drupal\Core\Field\Plugin\Field\FieldFormatter

Code

protected function numberFormat($number) {
  return number_format($number, $this
    ->getSetting('scale'), $this
    ->getSetting('decimal_separator'), $this
    ->getSetting('thousand_separator'));
}