Fix comparisons with almost-floats. Fix

thomasloven/lovelace-useful-markdown-card#16
This commit is contained in:
thomas committed 2019-05-03 14:31:15 +02:00
1 parent c885db9f8e
commit dae88747ef
1 file changed
+1 -1
+1 -1
View File
@@ -300,7 +300,7 @@ class {
const lhs = this.parseTemplateString(str[1]);
const rhs = this.parseTemplateString(str[3]);
var expr = ''
if(!parseFloat(lhs))
if(parseFloat(lhs) != lhs)
expr = `"${lhs}" ${str[2]} "${rhs}"`;
else
expr = `${parseFloat(lhs)} ${str[2]} ${parseFloat(rhs)}`