Skip to content

Commit

Permalink
fix dictionaries in JS : compare int to float
Browse files Browse the repository at this point in the history
  • Loading branch information
clavay committed Mar 22, 2022
1 parent 4762621 commit 5cf1ebc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyscada/hmi/static/pyscada/js/pyscada/pyscada_v0-7-0rc14.js
Original file line number Diff line number Diff line change
Expand Up @@ -754,9 +754,9 @@ function dictionary(id,val){
t = JSON.parse($(".variable-config[data-dictionary][data-id=" + id + "]").attr('data-dictionary'))
if (val in t) {
val = t[val]
}else if (val + ".0" in t) {
}else if (parseFloat(val).toFixed(1) in t) {
//int stored as a float
val = t[val + ".0"]
val = t[parseFloat(val).toFixed(1)]
}
}
return val;
Expand Down

0 comments on commit 5cf1ebc

Please sign in to comment.