You are here

protected function GeneralNumberFormatter::getFieldSuffixes in Formatter Suite 8

Returns the array of field suffixes, if any.

Return value

array Returns an array of 1 or 2 strings for singular and plural suffixes. If there are no suffixes, an array with '' is returned.

5 calls to GeneralNumberFormatter::getFieldSuffixes()
GeneralNumberFormatter::numberFormatBasic in src/Plugin/Field/FieldFormatter/GeneralNumberFormatter.php
Formats a number using the basic set of formatting features.
GeneralNumberFormatter::numberFormatGeneral in src/Plugin/Field/FieldFormatter/GeneralNumberFormatter.php
Formats a number using the general set of formatting features.
GeneralNumberFormatter::numberFormatNumeral in src/Plugin/Field/FieldFormatter/GeneralNumberFormatter.php
Formats a number using a number system base.
GeneralNumberFormatter::numberFormatScientific in src/Plugin/Field/FieldFormatter/GeneralNumberFormatter.php
Formats a number using scientific notation.
GeneralNumberWithMinMaxFormatter::numberFormat in src/Plugin/Field/FieldFormatter/GeneralNumberWithMinMaxFormatter.php
Returns a formatted number, including min, max, prefix, and suffix.

File

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

Class

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

Namespace

Drupal\formatter_suite\Plugin\Field\FieldFormatter

Code

protected function getFieldSuffixes() {
  $fieldSettings = $this
    ->getFieldSettings();

  // Get the prefixes and suffixes. For each one, the value is an array
  // of 1 or 2 entries for singular and optional plural values.
  $suffixes = [
    '',
  ];
  if (isset($fieldSettings['suffix']) === TRUE) {
    $suffixes = array_map([
      'Drupal\\Core\\Field\\FieldFilteredMarkup',
      'create',
    ], explode('|', $fieldSettings['suffix']));
  }
  return $suffixes;
}