Fix comparisons with almost-floats. Fix
thomasloven/lovelace-useful-markdown-card#16
This commit is contained in:
parent
c885db9f8e
commit
dae88747ef
@ -300,7 +300,7 @@ class {
|
|||||||
const lhs = this.parseTemplateString(str[1]);
|
const lhs = this.parseTemplateString(str[1]);
|
||||||
const rhs = this.parseTemplateString(str[3]);
|
const rhs = this.parseTemplateString(str[3]);
|
||||||
var expr = ''
|
var expr = ''
|
||||||
if(!parseFloat(lhs))
|
if(parseFloat(lhs) != lhs)
|
||||||
expr = `"${lhs}" ${str[2]} "${rhs}"`;
|
expr = `"${lhs}" ${str[2]} "${rhs}"`;
|
||||||
else
|
else
|
||||||
expr = `${parseFloat(lhs)} ${str[2]} ${parseFloat(rhs)}`
|
expr = `${parseFloat(lhs)} ${str[2]} ${parseFloat(rhs)}`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user