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 entries conform to locale setting, but seemingly get parsed with dot decimal, no matter. #78

Open
sinni800 opened this issue Jul 3, 2024 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@sinni800
Copy link

sinni800 commented Jul 3, 2024

image

So these contain commas, because my locale says commas are the decimal separator. If I try to put dot decimals in there, it automatically resets them to comma decimals before I can click save.

If I put comma decimals in there, they don't apply after hitting safe (only the whole part of the number applies, the decimals get chopped off)

If I set my OS to an english locale with dot decimals, it works fine.

Please parse the float coming out of there with the locale, .NET has

float.tryParse(f, Thread.CurrentThread.CurrentUICulture);

I assume that's the problem, I didn't check the code, but I've ran into the same problem as well, previously.

Second way would be to force the culture of the UI to also be invariant, then it doesn't matter.

@luttje luttje added bug Something isn't working help wanted Extra attention is needed labels Jul 4, 2024
@luttje
Copy link
Owner

luttje commented Jul 4, 2024

Hi there, thanks for reporting and helping out with some code right away!

I had a check in the source-code and I don't use any .Parse/.TryParse (according to GitHub search). Instead I use a NumericUpDown control which does the conversion for me: https://github.com/luttje/Key2Joy/blob/main/Key2Joy.Gui/Mapping/Actions/Input/GamePadStickActionControl.cs

That makes this situation quite confusing. I might be forcing a specific Locale somewhere?

Currently my focus is on other projects, so if anyone is able to help that's appreciated!

Until then this problem will have to wait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants