-
Notifications
You must be signed in to change notification settings - Fork 214
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
handling commas and dots input in parseToken of Parser #7514
Conversation
…aron/issue7424
…aron/issue7424
…aron/issue7424
…aron/issue7424
…aron/issue7424
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mathieu-fournier I'll let you chime in on whether we should check only commas and dots, or check all special characters (and if the special characters mentioned are enough or we missing any)
Just pushed a slightly different fix because Mathieu asked to handle multiple dots and comas mixed into numbers
the ones with comas is a bit tricky
the parsing skips comas because the parsing method thinks its a thousands separator so it ignores it, will look into it more. |
Oh, but if the algorithm detects this as thousands separator, it should not just strip it but instead consider its meaning. |
just pushed a fix handling multiple comas case. it passes all the tests but I just dont feel very secure with regular expression solutions. Couldnt think of a better fix at the moment. Let me know what you think. (cpp side behaves similarly with ignoring comas, I can work on that afterwards) This one probably wont work with Indian numbering system? i know they group numbers in 1,00,00,000. I wonder if coma is added as a thousandSeparator if we were to use that system. Just talked with Rob, gonna revert this commit and do loose checking instead talked with Colin (apparently he is closest of being UX responsible for core-quantity :) ). Made the call to ignore the comas now and i just logged this proposal in backlog |
#7487
Right now I have any input consists only special characters returning a parseError or a quantity with isValid field being false.
this should be all the special characters.
/^[!@#$%^&*()_+-=[]{};':"\|,.<>/?]+$/;
Let me know if thats expected, or we wanna handle just the dots/comas occurrences