Test if variable is numeric


/ Published in: JavaScript
Save to your folder(s)

Works !


Copy this code and paste it in your HTML
  1. function isNumeric(input) {
  2. return (input - 0) == input && input.length > 0;
  3. }

URL: http://www.ansermot.ch/devs/snippets/2011/javascript-test-if-variable-is-numeric.html

Report this snippet


Comments


You need to login to view comments.