After ajax query I have the next numbers:
var a = "5.20";
var b = "7.20";
var c = "11.20";
I have noticed that if compare numbers above 10.00
the condition is false. I do not understand why this happens
if (b > a) console.log("higher"); // true
if (c > b) console.log("higher"); // not true
I have solved the problem with next code (it should also work parseFloat
)
if ((+c) > (+b)) console.log("higher"); // true