mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
BUG - correcting size and non significant zeroes (#9575)
This commit is contained in:
@@ -121,7 +121,7 @@ foreach (dbFetchRows($sql, $param) as $sensor) {
|
|||||||
} else {
|
} else {
|
||||||
// we have another sensor
|
// we have another sensor
|
||||||
$current_label = get_sensor_label_color($sensor);
|
$current_label = get_sensor_label_color($sensor);
|
||||||
$sensor_current = "<span class='label $current_label'>".(format_si($sensor['sensor_current'])+0)." $unit</span>";
|
$sensor_current = "<span class='label $current_label'>".format_si($sensor['sensor_current']).$unit."</span>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$response[] = array(
|
$response[] = array(
|
||||||
|
|||||||
@@ -23,13 +23,13 @@ foreach (dbFetchRows('SELECT * FROM `sensors` WHERE `sensor_class` = ? AND `devi
|
|||||||
$sensor_current = get_state_label($sensor['state_generic_value'], $state_translation[0]['state_descr'] . " (".$sensor['sensor_current'].")");
|
$sensor_current = get_state_label($sensor['state_generic_value'], $state_translation[0]['state_descr'] . " (".$sensor['sensor_current'].")");
|
||||||
} else {
|
} else {
|
||||||
$current_label = get_sensor_label_color($sensor);
|
$current_label = get_sensor_label_color($sensor);
|
||||||
$sensor_current = "<span class='label $current_label'>".(format_si($sensor['sensor_current'])+0)." $unit</span>";
|
$sensor_current = "<span class='label $current_label'>".format_si($sensor['sensor_current']).$unit."</span>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sensor_limit = (format_si($sensor['sensor_limit'])+0)." $unit";
|
$sensor_limit = format_si($sensor['sensor_limit']).$unit;
|
||||||
$sensor_limit_low = (format_si($sensor['sensor_limit_low'])+0)." $unit";
|
$sensor_limit_low = format_si($sensor['sensor_limit_low']).$unit;
|
||||||
$sensor_limit_warn = (format_si($sensor['sensor_limit_warn'])+0)." $unit";
|
$sensor_limit_warn = format_si($sensor['sensor_limit_warn']).$unit;
|
||||||
$sensor_limit_low_warn = (format_si($sensor['sensor_limit_low_warn'])+0)." $unit";
|
$sensor_limit_low_warn = format_si($sensor['sensor_limit_low_warn']).$unit;
|
||||||
|
|
||||||
echo "<div class='panel panel-default'>
|
echo "<div class='panel panel-default'>
|
||||||
<div class='panel-heading'>
|
<div class='panel-heading'>
|
||||||
|
|||||||
@@ -627,7 +627,7 @@ function format_si($value, $round = '2', $sf = '3')
|
|||||||
$value = $value * -1;
|
$value = $value * -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return number_format(round($value, $round), $sf, '.', '').$ext;
|
return (number_format(round($value, $round), $sf, '.', '')+0)." ".$ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
function format_bi($value, $round = '2', $sf = '3')
|
function format_bi($value, $round = '2', $sf = '3')
|
||||||
@@ -646,8 +646,7 @@ function format_bi($value, $round = '2', $sf = '3')
|
|||||||
if ($neg) {
|
if ($neg) {
|
||||||
$value = $value * -1;
|
$value = $value * -1;
|
||||||
}
|
}
|
||||||
|
return (number_format(round($value, $round), $sf, '.', '')+0)." ".$ext;
|
||||||
return number_format(round($value, $round), $sf, '.', '').$ext;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function format_number($value, $base = '1000', $round = 2, $sf = 3)
|
function format_number($value, $base = '1000', $round = 2, $sf = 3)
|
||||||
|
|||||||
Reference in New Issue
Block a user