diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index b599b2a2ab..f6f000bc12 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -340,15 +340,17 @@ switch ($action) { break; } - $returnValue_value = explode(' ', $returnValue); + //~ $returnValue_value = explode(' ', $returnValue); $return = array(); if ($returnValue_value[1] != "") { - $return['value'] = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])) . " " . $returnValue_value[1]; + //~ $return['value'] = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])) . " " . $returnValue_value[1]; } else { - $return['value'] = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])); + //~ $return['value'] = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])); } + + $return['value'] = $returnValue; $return['max_percentile'] = $layoutData['height']; $return['width_percentile'] = $layoutData['width']; $return['unit_text'] = $unit_text; diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index d3819d53fc..8d851e348a 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -244,7 +244,7 @@ function format_for_graph ($number , $decimals = 1, $dec_point = ".", $thousands $number = $number / 1000; } - return format_numeric ($number, $decimals). $shorts[$pos]; //This will actually do the rounding and the decimals + return remove_right_zeros(format_numeric ($number, $decimals)). $shorts[$pos]; //This will actually do the rounding and the decimals } function human_milliseconds_to_string($seconds) { diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 22bc53f889..78c3cbb331 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -1013,19 +1013,20 @@ function visual_map_print_item($mode = "read", $layoutData, global $config; if ($type == SIMPLE_VALUE) { - $returnValue_value = explode(' ', $value); + //~ $returnValue_value = explode(' ', $value); + + //~ if ($returnValue_value[1] != "") { + //~ $value = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])) . " " . $returnValue_value[1]; + //~ } + //~ else { + //~ $value = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])); + //~ } - if ($returnValue_value[1] != "") { - $value = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])) . " " . $returnValue_value[1]; - } - else { - $value = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])); - } } else { // If the value is a string, dont format it if (!is_string($value)) { - $value = remove_right_zeros(format_for_graph($value, $config['graph_precision'])); + //~ $value = remove_right_zeros(format_for_graph($value, $config['graph_precision'])); } } @@ -1144,6 +1145,8 @@ function visual_map_get_simple_value_type($process_simple_value) { * @return string value retrieved with units */ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY) { + global $config; + $unit_text = db_get_sql ('SELECT unit FROM tagente_modulo WHERE id_agente_modulo = ' . $id_module); $unit_text = trim(io_safe_output($unit_text)); @@ -1157,7 +1160,7 @@ function visual_map_get_simple_value($type, $id_module, $period = SECONDS_1DAY) } else { if ( is_numeric($value) ) - $value = format_for_graph($value, 2); + $value = format_for_graph($value, $config['graph_precision']); if (!empty($unit_text)) { $value .= " " . $unit_text; }