function _views_summarize_get_cleaned_value in Views Summarize 7.2
Same name and namespace in other branches
- 7 views_summarize.module \_views_summarize_get_cleaned_value()
- 1.1.x views_summarize.module \_views_summarize_get_cleaned_value()
Gets the record's value after stripping invalid characters.
Parameters
string $value: The value from which to strip invalid characters.
array $options: The options element of the variables array that is passed into the summary theme function.
Return value
array The value with invalid characters removed.
3 calls to _views_summarize_get_cleaned_value()
- theme_views_summarize_type_average in ./
views_summarize.module - Themes the average of the values in the column.
- theme_views_summarize_type_range in ./
views_summarize.module - Themes the minimum and maximum values in the column.
- theme_views_summarize_type_total in ./
views_summarize.module - Themes the total of the values in the column.
File
- ./
views_summarize.module, line 543 - Provides a views display that outputs summaries of the values in a table.
Code
function _views_summarize_get_cleaned_value($value, array $options) {
$value = preg_replace('/[^0-9\\.\\,\\-]/', '', strip_tags($value));
if (!empty($options['field_settings']['thousand_separator'])) {
$value = str_replace($options['field_settings']['thousand_separator'], '', $value);
}
if (!empty($options['field_settings']['decimal_separator'])) {
$value = str_replace($options['field_settings']['decimal_separator'], '.', $value);
}
return $value;
}