added graph_precision for the float in static_graph and percentile item
Former-commit-id: 7fda14add9bcb0d9c0a425caad752364e29b309c
This commit is contained in:
parent
759c175d4f
commit
b57adb38a5
|
@ -222,12 +222,8 @@ final class Percentile extends Item
|
|||
);
|
||||
}
|
||||
|
||||
// Cast to float.
|
||||
$moduleValue = (float) $moduleValue;
|
||||
|
||||
// Store the module value.
|
||||
$data['value'] = $moduleValue;
|
||||
|
||||
$data['value'] = (float) \number_format((float) $moduleValue, (int) $config['graph_precision'], '.', '');
|
||||
$unit = \modules_get_unit($moduleId);
|
||||
if (empty($unit) === false) {
|
||||
$data['unit'] = \io_safe_output($unit);
|
||||
|
|
|
@ -226,7 +226,7 @@ final class StaticGraph extends Item
|
|||
|| ($isBooleanModule && $showLastValueTooltip !== 'default')
|
||||
) {
|
||||
if (\is_numeric($value)) {
|
||||
$imgTitle .= __('Last value: ').remove_right_zeros($value);
|
||||
$imgTitle .= __('Last value: ').remove_right_zeros(number_format((float) $value, (int) $config['graph_precision']));
|
||||
} else {
|
||||
$imgTitle .= __('Last value: ').$value;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue