Fix issues with string values

This commit is contained in:
José González 2021-08-20 14:11:03 +02:00
parent 8b9cb51d1e
commit 2f0681c29b
2 changed files with 27 additions and 9 deletions

View File

@ -2559,12 +2559,19 @@ function reporting_html_last_value($table, $item, $pdf=0)
'Y-m-d H:i:s',
$item['data']['utimestamp']
);
$table_data->data[1][2] = remove_right_zeros(
number_format(
$item['data']['datos'],
$config['graph_precision']
)
);
if (is_numeric($item['data']['datos']) === true) {
$dataDatos = remove_right_zeros(
number_format(
$item['data']['datos'],
$config['graph_precision']
)
);
} else {
$dataDatos = trim($item['data']['datos']);
}
$table_data->data[1][2] = $dataDatos;
switch ($item['data']['estado']) {
case AGENT_MODULE_STATUS_CRITICAL_BAD:

View File

@ -396,9 +396,20 @@ class ModuleValueWidget extends Widget
$output .= '<div class="container-icon">';
// Div value.
$output .= '<div style="flex: 0 1 '.$sizeValue.'px; font-size:'.$sizeValue.'px;">';
$output .= remove_right_zeros(
number_format($data_module, $config['graph_precision'])
);
if (is_numeric($data_module) === true) {
$dataDatos = remove_right_zeros(
number_format(
$data_module,
$config['graph_precision']
)
);
} else {
$dataDatos = trim($data_module);
}
$output .= $dataDatos;
$output .= '</div>';
if (empty($label) === false) {