Is there a way to tell if a number is a decimal, that is, if it contains a "comma"?;
A code I found was this:
Html
<input type="text" onblur="isNumber(this.value)" id="text" />
JavaScript
function isNumber(text){
valor = parseFloat(text);
if ((!isNaN(valor))==false){
alert("Por favor, não digite ...");}
return true;
}
Via: link
But it is not working. To see how it went here
To summarize, I only want a condition that returns
true
to: 5.69541
e
false
to: 569
.
Thank you.