From ed63e974af42ea2f93d357178f7305b02e42acd7 Mon Sep 17 00:00:00 2001 From: Nathan Haug <nate@lullabot.com> Date: Mon, 17 Mar 2014 19:27:21 -0700 Subject: [PATCH] Issue #2208797: Strip commas and spaces before casting Views data to a float. --- views/charts_plugin_style_chart.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/views/charts_plugin_style_chart.inc b/views/charts_plugin_style_chart.inc index 2eb0d79..baeafde 100644 --- a/views/charts_plugin_style_chart.inc +++ b/views/charts_plugin_style_chart.inc @@ -228,8 +228,9 @@ class charts_plugin_style_chart extends views_plugin_style { if ($renders[$row_number][$field_key] === '') { $value = NULL; } + // Strip thousands placeholders if present, then cast to float. 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; } -- GitLab