-
Notifications
You must be signed in to change notification settings - Fork 20.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make jQuery.isNumeric consistent #2662
Comments
@dmethvin, @gibson042 and I propose allowing all input and returning true for strings and numbers – whether primitive or object – that can be numeric. |
jQuery.isNumeric = function( input ) {
var type = jQuery.type( input );
return ( type === "number" || type === "string" ) && ( input - parseFloat( input ) + 1 ) >= 0;
}; |
timmywil
added a commit
to timmywil/jquery
that referenced
this issue
Oct 18, 2015
This was referenced Oct 18, 2015
timmywil
added a commit
to timmywil/jquery
that referenced
this issue
Oct 18, 2015
I added the behavior change tag since there's that one strange case with a custom |
timmywil
added a commit
to timmywil/jquery
that referenced
this issue
Oct 21, 2015
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Some people understand
isNumeric
as, "can I do math on this thing?" Others are asking, "Is this actually a number?" Now that we have no internal usage ofjQuery.isNumeric
, I think we can choose one or the other and update the documentation. Right now, it is inconsistent and a confusing confluence of the two.The text was updated successfully, but these errors were encountered: