jacob-on-stackoverflow jacob-on-stackoverflow - 6 months ago 37
AngularJS Question

Why does JavaScript get this comparison wrong?

This is happening on an angular application I'm building. If a user enters 80 into an HTML input, it always seems to get this comparison wrong.

var x = '80';
var y = 150.9800;

/* Returns incorrect answer */
if (parceFloat(x) < y) {
return true;
} else {
return false;


parceFloat() is not a function, the function is parseFloat()

A simple typo is all the error there is.