Added a function to remove right zeros in precision data feature
This commit is contained in:
parent
1a4866fb3b
commit
26862b5f9d
|
@ -284,7 +284,7 @@ if ($get_module_detail) {
|
|||
}
|
||||
else if (is_numeric($row[$attr[0]]) && !modules_is_string_type($row['module_type']) ) {
|
||||
|
||||
$data[] = number_format($row[$attr[0]], $config['graph_precision']);
|
||||
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
|
||||
}
|
||||
else {
|
||||
if ($row[$attr[0]] == '') {
|
||||
|
@ -909,12 +909,12 @@ if ($list_modules) {
|
|||
$salida = $config["render_proc_fail"];
|
||||
break;
|
||||
default:
|
||||
$salida = number_format($module["datos"], $config['graph_precision']);
|
||||
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$salida = number_format($module["datos"], $config['graph_precision']);
|
||||
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
|
||||
}
|
||||
// Show units ONLY in numeric data types
|
||||
if (isset($module["unit"])) {
|
||||
|
|
|
@ -344,10 +344,10 @@ switch ($action) {
|
|||
|
||||
$return = array();
|
||||
if ($returnValue_value[1] != "") {
|
||||
$return['value'] = 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'] = number_format($returnValue_value[0], $config['graph_precision']);
|
||||
$return['value'] = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision']));
|
||||
}
|
||||
$return['max_percentile'] = $layoutData['height'];
|
||||
$return['width_percentile'] = $layoutData['width'];
|
||||
|
|
|
@ -2636,4 +2636,9 @@ function pandora_setlocale() {
|
|||
setlocale(LC_ALL,
|
||||
str_replace(array_keys($replace_locale), $replace_locale, $user_language));
|
||||
}
|
||||
|
||||
function remove_right_zeros ($value) {
|
||||
$value_to_return = rtrim($value, "0");
|
||||
return rtrim($value_to_return, ".");
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -74,10 +74,10 @@ function get_graph_statistics ($chart_array) {
|
|||
}
|
||||
|
||||
//Format stat data to display properly
|
||||
$stats['last'] = number_format($stats['last'], $config['graph_precision']);
|
||||
$stats['avg'] = number_format($stats['avg'], $config['graph_precision']);
|
||||
$stats['min'] = number_format($stats['min'], $config['graph_precision']);
|
||||
$stats['max'] = number_format($stats['max'], $config['graph_precision']);
|
||||
$stats['last'] = remove_right_zeros(number_format($stats['last'], $config['graph_precision']));
|
||||
$stats['avg'] = remove_right_zeros(number_format($stats['avg'], $config['graph_precision']));
|
||||
$stats['min'] = remove_right_zeros(number_format($stats['min'], $config['graph_precision']));
|
||||
$stats['max'] = remove_right_zeros(number_format($stats['max'], $config['graph_precision']));
|
||||
|
||||
return $stats;
|
||||
}
|
||||
|
@ -734,16 +734,16 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
|
|||
|
||||
if ($dashboard || $vconsole) {
|
||||
$legend['sum'.$series_suffix] =
|
||||
__('Last') . ': ' . number_format($graph_stats['sum']['last'], $config['graph_precision']) . ($unit ? ' ' . $unit : '') . ' ; '
|
||||
. __('Avg') . ': ' . number_format($graph_stats['sum']['avg'], $config['graph_precision']) . ($unit ? ' ' . $unit : '');
|
||||
__('Last') . ': ' . remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])) . ($unit ? ' ' . $unit : '') . ' ; '
|
||||
. __('Avg') . ': ' . remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])) . ($unit ? ' ' . $unit : '');
|
||||
}
|
||||
else if (!$avg_only) {
|
||||
$legend['max'.$series_suffix] = __('Max').$series_suffix_str.': '.__('Last').': '.number_format($graph_stats['max']['last'], $config['graph_precision']).' '.$unit.' ; '.__('Avg').': '.number_format($graph_stats['max']['avg'], $config['graph_precision']).' '.$unit.' ; '.__('Max').': '.number_format($graph_stats['max']['max'], $config['graph_precision']).' '.$unit.' ; '.__('Min').': '.number_format($graph_stats['max']['min'], $config['graph_precision']).' '.$unit.' --> '.__('Selected');
|
||||
$legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.number_format($graph_stats['sum']['last'], $config['graph_precision']).' '.$unit.' ; '.__('Avg').': '.number_format($graph_stats['sum']['avg'], $config['graph_precision']).' '.$unit.' ; '.__('Max').': '.number_format($graph_stats['sum']['max'], $config['graph_precision']).' '.$unit.' ; '.__('Min').': '.number_format($graph_stats['sum']['min'], $config['graph_precision']).' '.$unit.' --> '.__('Selected');
|
||||
$legend['min'.$series_suffix] = __('Min').$series_suffix_str.': '.__('Last').': '.number_format($graph_stats['min']['last'], $config['graph_precision']).' '.$unit.' ; '.__('Avg').': '.number_format($graph_stats['min']['avg'], $config['graph_precision']).' '.$unit.' ; '.__('Max').': '.number_format($graph_stats['min']['max'], $config['graph_precision']).' '.$unit.' ; '.__('Min').': '.number_format($graph_stats['min']['min'], $config['graph_precision']).' '.$unit.' --> '.__('Selected');
|
||||
$legend['max'.$series_suffix] = __('Max').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['max']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['max']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['max']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['max']['min'], $config['graph_precision'])).' '.$unit.' --> '.__('Selected');
|
||||
$legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit.' --> '.__('Selected');
|
||||
$legend['min'.$series_suffix] = __('Min').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['min']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['min']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['min']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['min']['min'], $config['graph_precision'])).' '.$unit.' --> '.__('Selected');
|
||||
}
|
||||
else {
|
||||
$legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.number_format($graph_stats['sum']['last'], $config['graph_precision']).' '.$unit.' ; '.__('Avg').': '.number_format($graph_stats['sum']['avg'], $config['graph_precision']).' '.$unit.' ; '.__('Max').': '.number_format($graph_stats['sum']['max'], $config['graph_precision']).' '.$unit.' ; '.__('Min').': '.number_format($graph_stats['sum']['min'], $config['graph_precision']).' '.$unit.' --> '.__('Selected');
|
||||
$legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit.' --> '.__('Selected');
|
||||
}
|
||||
//Baseline was replaced by compare graph feature
|
||||
/*if ($baseline) {
|
||||
|
@ -1348,30 +1348,30 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
|||
$last = $graph_stats['last'];
|
||||
|
||||
if ($min > 1000000)
|
||||
$min = sprintf("%sM", number_format($min / 1000000, $config['graph_precision']));
|
||||
$min = sprintf("%sM", remove_right_zeros(number_format($min / 1000000, remove_right_zeros)));
|
||||
else if ($min > 1000)
|
||||
$min = sprintf("%sK", number_format($min / 1000, $config['graph_precision']));
|
||||
$min = sprintf("%sK", remove_right_zeros(number_format($min / 1000, $config['graph_precision'])));
|
||||
|
||||
if ($max > 1000000)
|
||||
$max = sprintf("%sM", number_format($max / 1000000, $config['graph_precision']));
|
||||
$max = sprintf("%sM", remove_right_zeros(number_format($max / 1000000, $config['graph_precision'])));
|
||||
else if ($max > 1000)
|
||||
$max = sprintf("%sK", number_format($max / 1000, $config['graph_precision']));
|
||||
$max = sprintf("%sK", remove_right_zeros(number_format($max / 1000, $config['graph_precision'])));
|
||||
|
||||
if ($avg > 1000000)
|
||||
$avg = sprintf("%sM", number_format($avg / 1000000, $config['graph_precision']));
|
||||
$avg = sprintf("%sM", remove_right_zeros(number_format($avg / 1000000, $config['graph_precision'])));
|
||||
else if ($avg > 1000)
|
||||
$avg = sprintf("%sK", number_format($avg / 1000, $config['graph_precision']));
|
||||
$avg = sprintf("%sK", remove_right_zeros(number_format($avg / 1000, $config['graph_precision'])));
|
||||
|
||||
if ($last > 1000000)
|
||||
$last = sprintf("%sM", number_format($last / 1000000, $config['graph_precision']));
|
||||
$last = sprintf("%sM", remove_right_zeros(number_format($last / 1000000, $config['graph_precision'])));
|
||||
else if ($last > 1000)
|
||||
$last = sprintf("%sK", number_format($last / 1000, $config['graph_precision']));
|
||||
$last = sprintf("%sK", remove_right_zeros(number_format($last / 1000, $config['graph_precision'])));
|
||||
}
|
||||
else {
|
||||
$min = number_format($graph_stats['min'], $config['graph_precision']);
|
||||
$max = number_format($graph_stats['max'], $config['graph_precision']);
|
||||
$avg = number_format($graph_stats['avg'], $config['graph_precision']);
|
||||
$last = number_format($graph_stats['last'], $config['graph_precision']);
|
||||
$min = remove_right_zeros(number_format($graph_stats['min'], $config['graph_precision']));
|
||||
$max = remove_right_zeros(number_format($graph_stats['max'], $config['graph_precision']));
|
||||
$avg = remove_right_zeros(number_format($graph_stats['avg'], $config['graph_precision']));
|
||||
$last = remove_right_zeros(number_format($graph_stats['last'], $config['graph_precision']));
|
||||
}
|
||||
|
||||
|
||||
|
@ -3750,12 +3750,12 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||
if (!$avg_only) {
|
||||
//Boolean graph doesn't have max!!!
|
||||
//$legend['max'.$series_suffix] = __('Max').$series_suffix_str .': '.__('Last').': '.$graph_stats['max']['last'].' '.$unit.' ; '.__('Avg').': '.$graph_stats['max']['avg'].' '.$unit.' ; '.__('Max').': '.$graph_stats['max']['max'].' '.$unit.' ; '.__('Min').': '.$graph_stats['max']['min'].' '.$unit;
|
||||
$legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.number_format($graph_stats['sum']['last'], $config['graph_precision']).' '.$unit.' ; '.__('Avg').': '.number_format($graph_stats['sum']['avg'], $config['graph_precision']).' '.$unit.' ; '.__('Max').': '.number_format($graph_stats['sum']['max'], $config['graph_precision']).' '.$unit.' ; '.__('Min').': '.number_format($graph_stats['sum']['min'], $config['graph_precision']).' '.$unit;
|
||||
$legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit;
|
||||
// Boolean graph doesn't have min!!!
|
||||
// $legend['min'.$series_suffix] = __('Min').$series_suffix_str .': '.__('Last').': '.number_format($graph_stats['min']['last'], $config['graph_precision']).' '.$unit.' ; '.__('Avg').': '.number_format($graph_stats['min']['avg'], $config['graph_precision']).' '.$unit.' ; '.__('Max').': '.number_format($graph_stats['min']['max'], $config['graph_precision']).' '.$unit.' ; '.__('Min').': '.number_format($graph_stats['min']['min'], $config['graph_precision']).' '.$unit;
|
||||
}
|
||||
else {
|
||||
$legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.number_format($graph_stats['sum']['last'], $config['graph_precision']).' '.$unit.' ; '.__('Avg').': '.number_format($graph_stats['sum']['avg'], $config['graph_precision']).' '.$unit.' ; '.__('Max').': '.number_format($graph_stats['sum']['max'], $config['graph_precision']).' '.$unit.' ; '.__('Min').': '.number_format($graph_stats['sum']['min'], $config['graph_precision']).' '.$unit;
|
||||
$legend['sum'.$series_suffix] = __('Avg').$series_suffix_str.': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit;
|
||||
|
||||
}
|
||||
|
||||
|
@ -4416,13 +4416,13 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events,
|
|||
}
|
||||
|
||||
if (!$avg_only) {
|
||||
$legend['max'] = __('Max').': '.__('Last').': '.number_format($graph_stats['max']['last'], $config['graph_precision']).' '.$unit.' ; '.__('Avg').': '.number_format($graph_stats['max']['avg'], $config['graph_precision']).' '.$unit.' ; '.__('Max').': '.number_format($graph_stats['max']['max'], $config['graph_precision']).' '.$unit.' ; '.__('Min').': '.number_format($graph_stats['max']['min'], $config['graph_precision']).' '.$unit;
|
||||
$legend['max'] = __('Max').': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['max']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['max']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['max']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['max']['min'], $config['graph_precision'])).' '.$unit;
|
||||
}
|
||||
|
||||
$legend['sum'] = __('Avg').': '.__('Last').': '.number_format($graph_stats['sum']['last'], $config['graph_precision']).' '.$unit.' ; '.__('Avg').': '.number_format($graph_stats['sum']['avg'], $config['graph_precision']).' '.$unit.' ; '.__('Max').': '.number_format($graph_stats['sum']['max'], $config['graph_precision']).' '.$unit.' ; '.__('Min').': '.number_format($graph_stats['sum']['min'], $config['graph_precision']).' '.$unit;
|
||||
$legend['sum'] = __('Avg').': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['sum']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['sum']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['sum']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['sum']['min'], $config['graph_precision'])).' '.$unit;
|
||||
|
||||
if (!$avg_only) {
|
||||
$legend['min'] = __('Min').': '.__('Last').': '.number_format($graph_stats['min']['last'], $config['graph_precision']).' '.$unit.' ; '.__('Avg').': '.number_format($graph_stats['min']['avg'], $config['graph_precision']).' '.$unit.' ; '.__('Max').': '.number_format($graph_stats['min']['max'], $config['graph_precision']).' '.$unit.' ; '.__('Min').': '.number_format($graph_stats['min']['min'], $config['graph_precision']).' '.$unit;
|
||||
$legend['min'] = __('Min').': '.__('Last').': '.remove_right_zeros(number_format($graph_stats['min']['last'], $config['graph_precision'])).' '.$unit.' ; '.__('Avg').': '.remove_right_zeros(number_format($graph_stats['min']['avg'], $config['graph_precision'])).' '.$unit.' ; '.__('Max').': '.remove_right_zeros(number_format($graph_stats['min']['max'], $config['graph_precision'])).' '.$unit.' ; '.__('Min').': '.remove_right_zeros(number_format($graph_stats['min']['min'], $config['graph_precision'])).' '.$unit;
|
||||
}
|
||||
|
||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||
|
|
|
@ -1880,7 +1880,7 @@ function modules_get_status($id_agent_module, $db_status, $data, &$status, &$tit
|
|||
}
|
||||
|
||||
if (is_numeric($data)) {
|
||||
$title .= ": " . number_format($data, $config['graph_precision']);
|
||||
$title .= ": " . remove_right_zeros(number_format($data, $config['graph_precision']));
|
||||
}
|
||||
else {
|
||||
$text = io_safe_output($data);
|
||||
|
|
|
@ -353,7 +353,7 @@ function reporting_html_SLA($table, $item, $mini) {
|
|||
$row = array();
|
||||
$row[] = $sla['agent'];
|
||||
$row[] = $sla['module'];
|
||||
$row[] = number_format($sla['max'], $config['graph_precision']) . " / " . number_format($sla['min'], $config['graph_precision']);
|
||||
$row[] = remove_right_zeros(number_format($sla['max'], $config['graph_precision'])) . " / " . remove_right_zeros(number_format($sla['min'], $config['graph_precision']));
|
||||
$row[] = round($sla['sla_limit'], 2) . "%";
|
||||
|
||||
if ($sla['sla_value_unknown']) {
|
||||
|
@ -380,7 +380,7 @@ function reporting_html_SLA($table, $item, $mini) {
|
|||
$row = array();
|
||||
$row[] = $sla['agent'];
|
||||
$row[] = $sla['module'];
|
||||
$row[] = number_format($sla['max'], $config['graph_precision']) . " / " . number_format($sla['min'], $config['graph_precision']);
|
||||
$row[] = remove_right_zeros(number_format($sla['max'], $config['graph_precision'])) . " / " . remove_right_zeros(number_format($sla['min'], $config['graph_precision']));
|
||||
$row[] = round($sla['sla_limit'], 2) . "%";
|
||||
|
||||
if ($sla['sla_value_unknown']) {
|
||||
|
@ -1500,13 +1500,13 @@ function reporting_html_monitor_report($table, $item, $mini) {
|
|||
'<p style="font: bold ' . $font_size . 'em Arial, Sans-serif; color: ' . COL_NORMAL . ';">';
|
||||
$table1->data['data']['ok'] .=
|
||||
html_print_image("images/module_ok.png", true) . ' ' .
|
||||
__('OK') . ': ' . number_format($item['data']["ok"]["formated_value"], $config['graph_precision']).' %</p>';
|
||||
__('OK') . ': ' . remove_right_zeros(number_format($item['data']["ok"]["formated_value"], $config['graph_precision'])).' %</p>';
|
||||
|
||||
$table1->data['data']['fail'] =
|
||||
'<p style="font: bold ' . $font_size . 'em Arial, Sans-serif; color: ' . COL_CRITICAL . ';">';
|
||||
$table1->data['data']['fail'] .=
|
||||
html_print_image("images/module_critical.png", true) . ' ' .
|
||||
__('Not OK') . ': ' . number_format($item['data']["fail"]["formated_value"], $config['graph_precision']) . ' % ' . '</p>';
|
||||
__('Not OK') . ': ' . remove_right_zeros(number_format($item['data']["fail"]["formated_value"], $config['graph_precision'])) . ' % ' . '</p>';
|
||||
}
|
||||
|
||||
$table->data['module']['cell'] = html_print_table($table1, true);
|
||||
|
@ -1744,10 +1744,10 @@ function reporting_html_availability(&$table, $item) {
|
|||
$table_row[] = $row['availability_item'];
|
||||
$table_row[] = $row['checks'];
|
||||
$table_row[] = $row['failed'];
|
||||
$table_row[] = number_format($row['fail'], $config['graph_precision']);
|
||||
$table_row[] = remove_right_zeros(number_format($row['fail'], $config['graph_precision']));
|
||||
$table_row[] = $row['poling_time'];
|
||||
$table_row[] = $row['time_unavaliable'];
|
||||
$table_row[] = number_format($row['ok'], $config['graph_precision']);
|
||||
$table_row[] = remove_right_zeros(number_format($row['ok'], $config['graph_precision']));
|
||||
}
|
||||
else {
|
||||
if ($item['date']['to'] > $the_first_men_time) {
|
||||
|
@ -1756,10 +1756,10 @@ function reporting_html_availability(&$table, $item) {
|
|||
$table_row[] = $row['availability_item'];
|
||||
$table_row[] = $row['checks'];
|
||||
$table_row[] = $row['failed'];
|
||||
$table_row[] = number_format($row['fail'], $config['graph_precision']);
|
||||
$table_row[] = remove_right_zeros(number_format($row['fail'], $config['graph_precision']));
|
||||
$table_row[] = $row['poling_time'];
|
||||
$table_row[] = $row['time_unavaliable'];
|
||||
$table_row[] = number_format($row['ok'], $config['graph_precision']);
|
||||
$table_row[] = remove_right_zeros(number_format($row['ok'], $config['graph_precision']));
|
||||
}
|
||||
else {
|
||||
$same_agent_in_resume = $row['agent'];
|
||||
|
@ -1809,10 +1809,10 @@ function reporting_html_availability(&$table, $item) {
|
|||
|
||||
$table1->data[] = array(
|
||||
'max_text' => $item['resume']['min_text'],
|
||||
'max' => number_format($item['resume']['max'], $config['graph_precision']) . "%",
|
||||
'avg' => number_format($item['resume']['avg'], $config['graph_precision']) . "%",
|
||||
'max' => remove_right_zeros(number_format($item['resume']['max'], $config['graph_precision'])) . "%",
|
||||
'avg' => remove_right_zeros(number_format($item['resume']['avg'], $config['graph_precision'])) . "%",
|
||||
'min_text' => $item['resume']['max_text'],
|
||||
'min' => number_format($item['resume']['min'], $config['graph_precision']) . "%"
|
||||
'min' => remove_right_zeros(number_format($item['resume']['min'], $config['graph_precision'])) . "%"
|
||||
);
|
||||
|
||||
$table->colspan[2][0] = 3;
|
||||
|
|
|
@ -1014,16 +1014,16 @@ function visual_map_print_item($mode = "read", $layoutData,
|
|||
$returnValue_value = explode(' ', $value);
|
||||
|
||||
if ($returnValue_value[1] != "") {
|
||||
$value = number_format($returnValue_value[0], $config['graph_precision']) . " " . $returnValue_value[1];
|
||||
$value = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])) . " " . $returnValue_value[1];
|
||||
}
|
||||
else {
|
||||
$value = number_format($returnValue_value[0], $config['graph_precision']);
|
||||
$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 = format_for_graph($value, $config['graph_precision']);
|
||||
$value = remove_right_zeros(format_for_graph($value, $config['graph_precision']));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -548,11 +548,11 @@ function flot_custom_pie_chart ($flash_charts, $graph_values,
|
|||
foreach ($graph_values as $label => $value) {
|
||||
if ($value['value']) {
|
||||
if ($value['value'] > 1000000)
|
||||
$legendvalue = sprintf("%sM", number_format($value['value'] / 1000000, $config['graph_precision']));
|
||||
$legendvalue = sprintf("%sM", remove_right_zeros(number_format($value['value'] / 1000000, $config['graph_precision'])));
|
||||
else if ($value['value'] > 1000)
|
||||
$legendvalue = sprintf("%sK", number_format($value['value'] / 1000, $config['graph_precision']));
|
||||
$legendvalue = sprintf("%sK", remove_right_zeros(number_format($value['value'] / 1000, $config['graph_precision'])));
|
||||
else
|
||||
$legendvalue = number_format($value['value'], $config['graph_precision']);
|
||||
$legendvalue = remove_right_zeros(number_format($value['value'], $config['graph_precision']));
|
||||
}
|
||||
else
|
||||
$legendvalue = __('No data');
|
||||
|
|
|
@ -1138,7 +1138,7 @@ if (!empty($result)) {
|
|||
elseif ($row['estado'] == 0) {
|
||||
if (is_numeric($row['datos'])) {
|
||||
$data[6] = ui_print_status_image(STATUS_MODULE_OK,
|
||||
__('NORMAL') . ': ' . number_format($row['datos'], $config['graph_precision']), true);
|
||||
__('NORMAL') . ': ' . remove_right_zeros(number_format($row['datos'], $config['graph_precision'])), true);
|
||||
}
|
||||
else {
|
||||
$data[6] = ui_print_status_image(STATUS_MODULE_OK,
|
||||
|
@ -1148,7 +1148,7 @@ if (!empty($result)) {
|
|||
elseif ($row['estado'] == 1) {
|
||||
if (is_numeric($row['datos'])) {
|
||||
$data[6] = ui_print_status_image(STATUS_MODULE_CRITICAL,
|
||||
__('CRITICAL') . ': ' . number_format($row['datos'], $config['graph_precision']), true);
|
||||
__('CRITICAL') . ': ' . remove_right_zeros(number_format($row['datos'], $config['graph_precision'])), true);
|
||||
}
|
||||
else {
|
||||
$data[6] = ui_print_status_image(STATUS_MODULE_CRITICAL,
|
||||
|
@ -1158,7 +1158,7 @@ if (!empty($result)) {
|
|||
elseif ($row['estado'] == 2) {
|
||||
if (is_numeric($row['datos'])) {
|
||||
$data[6] = ui_print_status_image(STATUS_MODULE_WARNING,
|
||||
__('WARNING') . ': ' . number_format($row['datos'], $config['graph_precision']), true);
|
||||
__('WARNING') . ': ' . remove_right_zeros(number_format($row['datos'], $config['graph_precision'])), true);
|
||||
}
|
||||
else {
|
||||
$data[6] = ui_print_status_image(STATUS_MODULE_WARNING,
|
||||
|
@ -1173,7 +1173,7 @@ if (!empty($result)) {
|
|||
if (is_numeric($row['datos'])) {
|
||||
$data[6] = ui_print_status_image(STATUS_MODULE_UNKNOWN,
|
||||
__('UNKNOWN') . ' - ' . __('Last status') . " " .
|
||||
__('NORMAL') . ': ' . number_format($row['datos'], $config['graph_precision']), true);
|
||||
__('NORMAL') . ': ' . remove_right_zeros(number_format($row['datos'], $config['graph_precision'])), true);
|
||||
}
|
||||
else {
|
||||
$data[6] = ui_print_status_image(STATUS_MODULE_UNKNOWN,
|
||||
|
@ -1185,7 +1185,7 @@ if (!empty($result)) {
|
|||
if (is_numeric($row['datos'])) {
|
||||
$data[6] = ui_print_status_image(STATUS_MODULE_UNKNOWN,
|
||||
__('UNKNOWN') . ' - ' . __('Last status') ." " .
|
||||
__('CRITICAL') . ': ' . number_format($row['datos'], $config['graph_precision']), true);
|
||||
__('CRITICAL') . ': ' . remove_right_zeros(number_format($row['datos'], $config['graph_precision'])), true);
|
||||
}
|
||||
else {
|
||||
$data[6] = ui_print_status_image(STATUS_MODULE_UNKNOWN,
|
||||
|
@ -1197,7 +1197,7 @@ if (!empty($result)) {
|
|||
if (is_numeric($row['datos'])) {
|
||||
$data[6] = ui_print_status_image(STATUS_MODULE_UNKNOWN,
|
||||
__('UNKNOWN') . ' - ' . __('Last status') . " " .
|
||||
__('WARNING') . ': ' . number_format($row['datos'], $config['graph_precision']), true);
|
||||
__('WARNING') . ': ' . remove_right_zeros(number_format($row['datos'], $config['graph_precision'])), true);
|
||||
}
|
||||
else {
|
||||
$data[6] = ui_print_status_image(STATUS_MODULE_UNKNOWN,
|
||||
|
@ -1281,12 +1281,12 @@ if (!empty($result)) {
|
|||
$salida = $config['render_proc_fail'];
|
||||
break;
|
||||
default:
|
||||
$salida = number_format($row['datos'], $config['graph_precision']);
|
||||
$salida = remove_right_zeros(number_format($row['datos'], $config['graph_precision']));
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$salida = number_format($row['datos'], $config['graph_precision']);
|
||||
$salida = remove_right_zeros(number_format($row['datos'], $config['graph_precision']));
|
||||
}
|
||||
|
||||
// Show units ONLY in numeric data types
|
||||
|
|
Loading…
Reference in New Issue