3 namespace Drupal\Core\Field\Plugin\Field\FieldFormatter;
6 * Plugin implementation of the 'number_integer' formatter.
8 * The 'Default' formatter is different for integer fields on the one hand, and
9 * for decimal and float fields on the other hand, in order to be able to use
13 * id = "number_integer",
14 * label = @Translation("Default"),
20 class IntegerFormatter extends NumericFormatterBase {
25 public static function defaultSettings() {
27 'thousand_separator' => '',
28 'prefix_suffix' => TRUE,
29 ] + parent::defaultSettings();
35 protected function numberFormat($number) {
36 return number_format($number, 0, '', $this->getSetting('thousand_separator'));