function NumericField::defineOptions

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/field/NumericField.php \Drupal\views\Plugin\views\field\NumericField::defineOptions()
  2. 8.9.x core/modules/views/src/Plugin/views/field/NumericField.php \Drupal\views\Plugin\views\field\NumericField::defineOptions()
  3. 10 core/modules/views/src/Plugin/views/field/NumericField.php \Drupal\views\Plugin\views\field\NumericField::defineOptions()

Overrides FieldPluginBase::defineOptions

1 call to NumericField::defineOptions()
NodeNewComments::defineOptions in core/modules/comment/src/Plugin/views/field/NodeNewComments.php
1 method overrides NumericField::defineOptions()
NodeNewComments::defineOptions in core/modules/comment/src/Plugin/views/field/NodeNewComments.php

File

core/modules/views/src/Plugin/views/field/NumericField.php, line 26

Class

NumericField
Render a field as a numeric value.

Namespace

Drupal\views\Plugin\views\field

Code

protected function defineOptions() {
    $options = parent::defineOptions();
    $options['set_precision'] = [
        'default' => FALSE,
    ];
    $options['precision'] = [
        'default' => 0,
    ];
    $options['decimal'] = [
        'default' => '.',
    ];
    $options['separator'] = [
        'default' => ',',
    ];
    $options['format_plural'] = [
        'default' => FALSE,
    ];
    $options['format_plural_string'] = [
        'default' => '1' . PoItem::DELIMITER . '@count',
    ];
    $options['prefix'] = [
        'default' => '',
    ];
    $options['suffix'] = [
        'default' => '',
    ];
    return $options;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.