Skip to content

Instantly share code, notes, and snippets.

@dankempster
Created March 13, 2012 18:56
Show Gist options
  • Save dankempster/2030754 to your computer and use it in GitHub Desktop.
Save dankempster/2030754 to your computer and use it in GitHub Desktop.
isNumeric function for JavaScript
/**
* 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