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

Decimal stripped on floats without leading digit #23

Closed
schelcj opened this issue Mar 18, 2017 · 0 comments
Closed

Decimal stripped on floats without leading digit #23

schelcj opened this issue Mar 18, 2017 · 0 comments

Comments

@schelcj
Copy link

schelcj commented Mar 18, 2017

If a field is marked numeric or number and the value parsed begins with . instead of a leading 0 the period is stripped off. For instance, if you pass .1 instead of 0.1 the parsed value becomes 1. This is a problem. This is related to the regex used to parse numbers expecting a sign, then digits, then optionally a period and more digits. However, the optional bit is ignored, the digit is captured and the period is dropped. This could be fixed by adding . to the character class before the first digit but I'm not sure that is the correct thing to do in all cases. Here's a gist example.

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