You are here

function number_field_formatter_settings_summary in Drupal 7

Implements hook_field_formatter_settings_summary().

File

modules/field/modules/number/number.module, line 279
Defines numeric field types.

Code

function number_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $summary = array();
  if ($display['type'] == 'number_decimal' || $display['type'] == 'number_integer') {
    $summary[] = number_format(1234.123456789, $settings['scale'], $settings['decimal_separator'], $settings['thousand_separator']);
    if ($settings['prefix_suffix']) {
      $summary[] = t('Display with prefix and suffix.');
    }
  }
  return implode('<br />', $summary);
}