You are here

protected function BigIntItemDefaultFormatter::numberFormat in Big Integer 8

Formats a number.

Parameters

mixed $number: The numeric value.

Return value

string The formatted number.

Overrides IntegerFormatter::numberFormat

File

src/Plugin/Field/FieldFormatter/BigIntItemDefaultFormatter.php, line 23

Class

BigIntItemDefaultFormatter
Plugin implementation of the 'Default' formatter for 'bigint' fields.

Namespace

Drupal\bigint\Plugin\Field\FieldFormatter

Code

protected function numberFormat($number) {
  $number = (string) $number;
  return strrev(implode($this
    ->getSetting('thousand_separator'), str_split(strrev($number), 3)));
}