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

Fix bug by making decimal input handling locale-independent #719

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

gemenerik
Copy link
Member

This PR addresses a critical bug where decimal inputs in the plotter's X range values were not processed correctly in locales that use a comma as the decimal separator. By replacing commas with dots, we ensure that numeric inputs are handled consistently across all locales, making the application's numeric input processing locale-independent.

This update sidesteps the complexities associated with using the locale module, providing a straightforward but dirty solution to the issue.

This commit addresses a critical bug where decimal inputs in the X range values were not processed correctly in locales that use a comma as the decimal separator. By replacing commas with dots, we ensure that numeric inputs are handled consistently across all locales, making the application's numeric input processing locale-independent.

This update sidesteps the complexities associated with using the `locale` module, providing a straightforward but dirty solution to the issue.

Co-authored-by: Tobias Antonson <[email protected]>
@gemenerik gemenerik requested a review from ToveRumar July 2, 2024 11:23
Copy link
Member

@ataffanel ataffanel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is indeed not the most elegant solution and my main problem is that the GUI does not respect the user's local. However this is how the client is currently working and this PR works. I tried to break it with setting big number and setting my local to include group separators (100.000,00) but I could not find a case where it broke. So this works fine, great efficient work!

@gemenerik
Copy link
Member Author

Thanks for the reviews

@gemenerik gemenerik merged commit b498f2e into master Jul 3, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

3 participants