You are here

protected static function GeneralNumberFormatter::getNotationStyles in Formatter Suite 8

Returns an array of notation styles.

A notation style indicates a broad category of numeric presentation, such as scientific notation vs. general number notation.

Return value

string[] Returns an associative array with internal names as keys and human-readable translated names as values.

2 calls to GeneralNumberFormatter::getNotationStyles()
GeneralNumberFormatter::sanitizeSettings in src/Plugin/Field/FieldFormatter/GeneralNumberFormatter.php
Sanitize settings to insure that they are safe and valid.
GeneralNumberFormatter::settingsForm in src/Plugin/Field/FieldFormatter/GeneralNumberFormatter.php
Returns a form to configure settings for the formatter.

File

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

Class

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

Namespace

Drupal\formatter_suite\Plugin\Field\FieldFormatter

Code

protected static function getNotationStyles() {
  return [
    'basicnumber' => t('Basic number'),
    'generalnumber' => t('General number'),
    'numeralsystem' => t('Numeral system'),
    'percentage' => t('Percentage'),
    'scientific' => t('Scientific'),
  ];
}