function DecimalFormatter::numberFormat

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/DecimalFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\DecimalFormatter::numberFormat()
  2. 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/DecimalFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\DecimalFormatter::numberFormat()
  3. 11.x core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/DecimalFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\DecimalFormatter::numberFormat()

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'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.