function number_field_info

Implements hook_field_info().

File

drupal/core/modules/number/number.module, line 26
Defines numeric field types.

Code

function number_field_info() {
  return array(
    'number_integer' => array(
      'label' => t('Integer'),
      'description' => t('This field stores a number in the database as an integer.'),
      'instance_settings' => array(
        'min' => '',
        'max' => '',
        'prefix' => '',
        'suffix' => '',
      ),
      'default_widget' => 'number',
      'default_formatter' => 'number_integer',
      'field item class' => '\\Drupal\\number\\Type\\IntegerItem',
    ),
    'number_decimal' => array(
      'label' => t('Decimal'),
      'description' => t('This field stores a number in the database in a fixed decimal format.'),
      'settings' => array(
        'precision' => 10,
        'scale' => 2,
      ),
      'instance_settings' => array(
        'min' => '',
        'max' => '',
        'prefix' => '',
        'suffix' => '',
      ),
      'default_widget' => 'number',
      'default_formatter' => 'number_decimal',
      'field item class' => '\\Drupal\\number\\Type\\DecimalItem',
    ),
    'number_float' => array(
      'label' => t('Float'),
      'description' => t('This field stores a number in the database in a floating point format.'),
      'instance_settings' => array(
        'min' => '',
        'max' => '',
        'prefix' => '',
        'suffix' => '',
      ),
      'default_widget' => 'number',
      'default_formatter' => 'number_decimal',
      'field item class' => '\\Drupal\\number\\Type\\FloatItem',
    ),
  );
}