Skip to content

Instantly share code, notes, and snippets.

@tstachl
Created October 7, 2010 06:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tstachl/614656 to your computer and use it in GitHub Desktop.
Save tstachl/614656 to your computer and use it in GitHub Desktop.
Mootools extension, check string is numeric.
String.implement({
isNumeric: function() {
var r = true;
this.split('').each(function(i) {
if ('0123456789.,'.indexOf(i) == -1) {
r = false;
}
});
return r;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment