protected function PriceDefaultFormatter::getFormattingOptions in Price 8
Same name and namespace in other branches
- 3.x src/Plugin/Field/FieldFormatter/PriceDefaultFormatter.php \Drupal\price\Plugin\Field\FieldFormatter\PriceDefaultFormatter::getFormattingOptions()
- 2.0.x src/Plugin/Field/FieldFormatter/PriceDefaultFormatter.php \Drupal\price\Plugin\Field\FieldFormatter\PriceDefaultFormatter::getFormattingOptions()
- 2.x src/Plugin/Field/FieldFormatter/PriceDefaultFormatter.php \Drupal\price\Plugin\Field\FieldFormatter\PriceDefaultFormatter::getFormattingOptions()
- 3.0.x src/Plugin/Field/FieldFormatter/PriceDefaultFormatter.php \Drupal\price\Plugin\Field\FieldFormatter\PriceDefaultFormatter::getFormattingOptions()
Gets the formatting options for the currency formatter.
Return value
array The formatting options.
1 call to PriceDefaultFormatter::getFormattingOptions()
- PriceDefaultFormatter::viewElements in src/
Plugin/ Field/ FieldFormatter/ PriceDefaultFormatter.php - Builds a renderable array for a field value.
File
- src/
Plugin/ Field/ FieldFormatter/ PriceDefaultFormatter.php, line 162
Class
- PriceDefaultFormatter
- Plugin implementation of the 'price_price_default' formatter.
Namespace
Drupal\price\Plugin\Field\FieldFormatterCode
protected function getFormattingOptions() {
$options = [
'currency_display' => $this
->getSetting('currency_display'),
];
if ($this
->getSetting('strip_trailing_zeroes')) {
$options['minimum_fraction_digits'] = 0;
}
return $options;
}