Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr-logrus committed Jan 20, 2023
1 parent c68de99 commit 89adad8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/devices/SCounters_valueUpdated.php
Expand Up @@ -25,11 +25,11 @@
if ($val1['ID']) {
SQLExec("DELETE FROM $table_name WHERE VALUE_ID=$value_id AND ADDED>=('" . $time . "')");
$set_value = $val1['VALUE'] + ($new_value - $old_value);
$set_value = round($set_value, 2);
$set_value = round($set_value, 3);
$this->setProperty($history_value, $set_value);
} else {
$set_value = $new_value - $old_value;
$set_value = round($set_value, 2);
$set_value = round($set_value, 3);
$this->setProperty($history_value, $set_value);
//DebMes($history_value . ' ' . $time . ' - id - ' . $value_id . ' - new - ' . $new_value . ' - old - ' . $old_value, $ot);
}
Expand Down
2 changes: 1 addition & 1 deletion modules/devices/SCounters_valueWorkUpdated.php
Expand Up @@ -42,7 +42,7 @@
}

$value = (float)$this->getProperty('value');
$data_value = round(($value + $diff), 2);
$data_value = round(($value + $diff), 3);

if ($value != $data_value) {
$this->setProperty('value', $data_value);
Expand Down

0 comments on commit 89adad8

Please sign in to comment.