protected function DecimalFormatter::numberFormat in Drupal 8
Same name and namespace in other branches
- 9 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\FieldFormatterCode
protected function numberFormat($number) {
return number_format($number, $this
->getSetting('scale'), $this
->getSetting('decimal_separator'), $this
->getSetting('thousand_separator'));
}