You are here

public static function GeneralNumberFormatter::defaultSettings in Formatter Suite 8

Defines the default settings for this plugin.

Return value

array A list of default settings, keyed by the setting name.

Overrides PluginSettingsBase::defaultSettings

3 calls to GeneralNumberFormatter::defaultSettings()
GeneralNumberFormatter::sanitizeSettings in src/Plugin/Field/FieldFormatter/GeneralNumberFormatter.php
Sanitize settings to insure that they are safe and valid.
GeneralNumberWithBarIndicatorFormatter::defaultSettings in src/Plugin/Field/FieldFormatter/GeneralNumberWithBarIndicatorFormatter.php
Defines the default settings for this plugin.
GeneralNumberWithMinMaxFormatter::defaultSettings in src/Plugin/Field/FieldFormatter/GeneralNumberWithMinMaxFormatter.php
Defines the default settings for this plugin.
2 methods override GeneralNumberFormatter::defaultSettings()
GeneralNumberWithBarIndicatorFormatter::defaultSettings in src/Plugin/Field/FieldFormatter/GeneralNumberWithBarIndicatorFormatter.php
Defines the default settings for this plugin.
GeneralNumberWithMinMaxFormatter::defaultSettings in src/Plugin/Field/FieldFormatter/GeneralNumberWithMinMaxFormatter.php
Defines the default settings for this plugin.

File

src/Plugin/Field/FieldFormatter/GeneralNumberFormatter.php, line 168

Class

GeneralNumberFormatter
Format a number field with a variety of notation styles and parameters.

Namespace

Drupal\formatter_suite\Plugin\Field\FieldFormatter

Code

public static function defaultSettings() {
  return array_merge([
    // Notation style.
    'notationStyle' => 'basicnumber',
    'exponentStyle' => 'enotation',
    // Precision.
    'decimalDigits' => '',
    'decimalSeparator' => '.',
    // Thousands.
    'useThousands' => FALSE,
    'thousandsSeparator' => ',',
    // Signs.
    'negativeStyle' => 'minus',
    'positiveStyle' => 'omit',
    // Padding.
    'useZeroPadding' => FALSE,
    'paddingWidth' => '',
    // Number base.
    'numberBase' => 10,
    // Prefix & suffix.
    'usePrefixAndSuffix' => TRUE,
    // List style.
    'listStyle' => 'span',
    'listSeparator' => ', ',
  ], parent::defaultSettings());
}