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

Default number format should be CultureInfo.CurrentCulture, not CurrentUICulture #787

Closed
pgrawehr opened this issue May 22, 2020 · 8 comments
Labels
breaking-change bug pinned Issues that should not be auto-closed due to inactivity.
Milestone

Comments

@pgrawehr
Copy link
Contributor

The default formatting of numbers (in QuantityFormatter.cs), when no explicit culture is given, should use CultureInfo.CurrentCulture not CultureInfo.CurrentUICulture. On Windows, the first corresponds to the selection from the control panel "Regional Settings" and defines the locale settings of the user. CurrentUICulture represents the language of the UI, which will be english for everyone that uses Windows in english.

In my case, CurrentUICulture is "de-DE", since my Windows is German, but CurrentCulture is "de-CH", since I use the number format for Switzerland (which is quite different).

@angularsen
Copy link
Owner

Thanks for reporting, you may be right. Will look into it.

@tmilnthorp
Copy link
Collaborator

It is correct, we're using the wrong one. This would be a behavior break though.

@stale
Copy link

stale bot commented Jul 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 25, 2020
@pgrawehr
Copy link
Contributor Author

No, I don't think this should be wontfix. A PR for this is pending (but apparently waiting for other stuff to get done as well)

@stale stale bot removed the wontfix label Jul 26, 2020
@tmilnthorp tmilnthorp added the pinned Issues that should not be auto-closed due to inactivity. label Jul 27, 2020
@pgrawehr
Copy link
Contributor Author

@angularsen @tmilnthorp Are there any plans when 4.X will be branched out so that some of the pending breaking changes could be implemented for 5.0? The number formatting is unfortunately poor, so that I keep doing it manually.

@angularsen
Copy link
Owner

@pgrawehr There is #982 now. Would you be interested in doing a PR to that branch?

@angularsen angularsen added this to the 5.0 milestone Nov 3, 2021
@pgrawehr
Copy link
Contributor Author

pgrawehr commented Nov 3, 2021

I'm quite busy at the moment, but I'll try to adapt #795 for that branch. I also need to check whether there's any leftovers from #788 (such as formatting obtions to remove or improve)

@angularsen angularsen changed the title Default number format should be CultureInfo.CurrentCulture, not CultureInfo.CurrentUICulture Default number format should be CultureInfo.CurrentCulture, not CurrentUICulture Nov 13, 2021
@angularsen angularsen modified the milestones: 5.0, vNext Feb 2, 2023
@angularsen
Copy link
Owner

If I am not mistaken, this was fixed in v5 by #986.

@angularsen angularsen modified the milestones: vNext, 5.0 Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change bug pinned Issues that should not be auto-closed due to inactivity.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants