Skip to content

Commit

Permalink
Handle decimal values
Browse files Browse the repository at this point in the history
  • Loading branch information
MeestorX committed Oct 13, 2023
1 parent ae2cc44 commit d10f5af
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ class instance extends InstanceBase {
}

parseVal(cmd) {
const varFuncs = require('./variables.js')
let val = cmd.Val

let rcpCmd = this.findRcpCmd(cmd.Address)
Expand All @@ -539,7 +538,7 @@ class instance extends InstanceBase {
if (isNaN(cmd.Val)) {
if (cmd.Val.toUpperCase() == '-INF') val = rcpCmd.Min
} else {
val = parseInt(cmd.Val || '0') * rcpCmd.Scale
val = parseInt(parseFloat(cmd.Val || '0') * rcpCmd.Scale)
}
}

Expand Down

0 comments on commit d10f5af

Please sign in to comment.