Skip to content

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

Merged
gemenerik merged 1 commit intomasterfrom
rik/localefix
Jul 3, 2024
Merged

Fix bug by making decimal input handling locale-independent#719
gemenerik merged 1 commit intomasterfrom
rik/localefix

Conversation

@gemenerik
Copy link
Copy Markdown
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 <tobbeanton@gmail.com>
@gemenerik gemenerik requested a review from ToveRumar July 2, 2024 11:23
Copy link
Copy Markdown
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
Copy Markdown
Member Author

Thanks for the reviews

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