Skip to content

Instantly share code, notes, and snippets.

@carlessistare
Created October 2, 2013 15:14
Show Gist options
  • Save carlessistare/6795338 to your computer and use it in GitHub Desktop.
Save carlessistare/6795338 to your computer and use it in GitHub Desktop.
Is float is int
function isInt(n)
{
return n != "" && !isNaN(n) && Math.round(n) == n;
}
function isFloat(n){
return n != "" && !isNaN(n) && Math.round(n) != n;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment