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

Prohibit the comma in numbers #2083

Closed

Conversation

ChALkeR
Copy link

@ChALkeR ChALkeR commented Sep 24, 2021

The logic below splits on .: value.split(".").

@ricmoo
Copy link
Member

ricmoo commented Sep 24, 2021

This is not a safe change to make. I know some locales use comma instead of period, but commas can also be used as thousands separators, so this could have other unintended consequences.

The benefit of having a strict input though does aid when locale-specific inputs is that it is easier to transform. For places where the input may be of Swiss, French, etc. input can be transformed using input.replace(",", "."). There is certainly room for someone to create a locale-sensing library for parsing input, which is actually quite a bit more complex than it may seem, but I would link to it if someone made something robust. ;)

@ricmoo
Copy link
Member

ricmoo commented Sep 24, 2021

Oh!!! I was completely wrong. I see know what you meant.

Yes, I will fix this in the next release. :)

@ricmoo
Copy link
Member

ricmoo commented Sep 24, 2021

(I totally read the diff backwards, thinking you wanted me to add support for the comma as a decimal separator)

@ricmoo ricmoo changed the title bignumber: , (comma) is not allowed, only . (dot) is Prohibit the comma in numbers Sep 24, 2021
@ricmoo ricmoo added bug Verified to be an issue. on-deck This Enhancement or Bug is currently being worked on. labels Sep 24, 2021
@ricmoo
Copy link
Member

ricmoo commented Oct 20, 2021

Great catch, btw. Merged in 5.5.0.

Thanks! :)

@ricmoo ricmoo closed this Oct 20, 2021
@ricmoo ricmoo added fixed/complete This Bug is fixed or Enhancement is complete and published. and removed on-deck This Enhancement or Bug is currently being worked on. labels Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants