Skip to content
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

isFloat incorrectly allows "." #443

Closed
ndetommaso opened this issue Oct 20, 2015 · 0 comments
Closed

isFloat incorrectly allows "." #443

ndetommaso opened this issue Oct 20, 2015 · 0 comments

Comments

@ndetommaso
Copy link

The regex for isFloat allows a string that is just a period. This is a consequence of the fact that nothing is required before the decimal (for cases like .123) and that nothing is required after the decimal (for cases like 123.).

You may want to go with the regex at the bottom of http://www.regular-expressions.info/floatingpoint.html, which I believe checks for all of the same properties that isFloat() checks for.

@chriso chriso closed this as completed in 902cfc9 Oct 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant