Categories
Uncategorized

Check the number for integer in JavaScript

If you want to check the number to be integer, you can use this function:

isInt = function(field) {
  if (+field != field || field.indexOf(".") != -1) {
    return false;
  } else {
    return true;
  }
}

Leave a Reply

Your email address will not be published. Required fields are marked *