Added validate function to validate numbers without formatting them