Created
March 13, 2012 18:56
-
-
Save dankempster/2030754 to your computer and use it in GitHub Desktop.
isNumeric function for JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This function was sourced from http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric | |
*/ | |
function isNumeric(n) { | |
return !isNaN(parseFloat(n)) && isFinite(n); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment