Skip to content
Snippets Groups Projects
Commit ed63e974 authored by Nathan Haug's avatar Nathan Haug
Browse files

Issue #2208797: Strip commas and spaces before casting Views data to a float.

parent ecf81427
No related branches found
No related tags found
No related merge requests found
...@@ -228,8 +228,9 @@ class charts_plugin_style_chart extends views_plugin_style { ...@@ -228,8 +228,9 @@ class charts_plugin_style_chart extends views_plugin_style {
if ($renders[$row_number][$field_key] === '') { if ($renders[$row_number][$field_key] === '') {
$value = NULL; $value = NULL;
} }
// Strip thousands placeholders if present, then cast to float.
else { else {
$value = (float) $renders[$row_number][$field_key]; $value = (float) str_replace(array(',', ' '), '', $renders[$row_number][$field_key]);
} }
$chart[$this->view->current_display . '__' . $field_key]['#data'][] = $value; $chart[$this->view->current_display . '__' . $field_key]['#data'][] = $value;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment