Search This Blog

Tuesday, November 8, 2011

Validate numbers in JavaScript - IsNumeric()

A simple function to find if a positive number
function isNumber(n) {
  return !isNaN(parseFloat(n)) && isFinite(n);
}

No comments: