You are here

protected function PriceTableDefaultFormatter::getFormattingOptions in Commerce Price Table 8

Gets the formatting options for the currency formatter.

Return value

array The formatting options.

Overrides PriceDefaultFormatter::getFormattingOptions

1 call to PriceTableDefaultFormatter::getFormattingOptions()
PriceTableDefaultFormatter::viewElements in src/Plugin/Field/FieldFormatter/PriceTableDefaultFormatter.php
Builds a renderable array for a field value.

File

src/Plugin/Field/FieldFormatter/PriceTableDefaultFormatter.php, line 165

Class

PriceTableDefaultFormatter
Plugin implementation of the 'commerce_price_table' formatter.

Namespace

Drupal\commerce_price_table\Plugin\Field\FieldFormatter

Code

protected function getFormattingOptions() {
  $options = [
    'currency_display' => $this
      ->getSetting('currency_display'),
  ];
  if ($this
    ->getSetting('strip_trailing_zeroes')) {
    $options['minimum_fraction_digits'] = 0;
  }
  return $options;
}