function number_field_formatter_settings_summary

Implements hook_field_formatter_settings_summary().

File

modules/field/modules/number/number.module, line 279

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);
}

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