An input element contains numbers a where comma or dot is used as decimal separator and space may be used to group thousands like this:
\'1,2\'
try this...
var withComma = "23,3"; var withFloat = "23.3"; var compareValue = function(str){ var fixed = parseFloat(str.replace(',','.')) if(fixed > 0){ console.log(true) }else{ console.log(false); } } compareValue(withComma); compareValue(withFloat);