Skip to content

Commit

Permalink
changed round of numbers in control states
Browse files Browse the repository at this point in the history
  • Loading branch information
BenAhrdt committed Mar 25, 2024
1 parent c91cf2e commit 797fca0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/modules/downlinkConfighandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ class downlinkConfighandlerClass {
case "number":
if(downlinkParameter.decimalPlaces){
const expotentialFactor = Math.pow(10,downlinkParameter.decimalPlaces);
const StateWithExotetialFactor = Math.trunc(state.val * expotentialFactor);
const StateWithExotetialFactor = Math.round(state.val * expotentialFactor);
this.adapter.log.warn(StateWithExotetialFactor);
resultAfterdecimalPlaces = StateWithExotetialFactor / expotentialFactor;
}
else{
Expand Down

0 comments on commit 797fca0

Please sign in to comment.