You are here

protected function RangeDecimalFormatter::formatNumber in Range 8

Formats a number.

Parameters

mixed $number: The numeric value.

Return value

string The formatted number.

Overrides RangeIntegerFormatter::formatNumber

File

src/Plugin/Field/FieldFormatter/RangeDecimalFormatter.php, line 64

Class

RangeDecimalFormatter
Plugin implementation of the 'range_decimal' formatter.

Namespace

Drupal\range\Plugin\Field\FieldFormatter

Code

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