Skip to content

Conversation

@nicolaihenriksen
Copy link
Contributor

Fixes #3858

This ensures that CultureInfo.CurrentCulture is used in the string conversions of the Value property throughout the control. This allows the control to be used in cultures that do not use a "dot" as the decimal separator (like danish da-DK for example).

Tests
I left a comment on the issue, because I wanted to write some UI tests for this, but I believe I am missing an API hook in XAMLTest that will allow me to inject a culture for the WPF app that is spun up. Feature request 😛


NOTE: The previous implementation was using CultureInfo.CurrentUICulture which I don't believe was correct. To my knowledge (and please correct me if I am wrong), the "UI" variant is newer property primarily used for translations of strings, whereas CultureInfo.CurrentCulture should be used for number formatting etc.

It is not uncommon for people like myself (at least in the dev world) to want to use their own local numbering scheme (thus CultureInfo.CurrentCulture=da-DK in my case), but still want UI strings to be in English (thus CultureInfo.CurrentUICulture=en-US in my case).

@nicolaihenriksen nicolaihenriksen added this to the 5.3.0 milestone Jun 1, 2025
@nicolaihenriksen nicolaihenriksen self-assigned this Jun 1, 2025
@Keboo Keboo merged commit c2c8793 into master Jun 6, 2025
2 checks passed
@Keboo Keboo deleted the fix3858 branch June 6, 2025 04:17
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.

DecimalUpDown only works for "en-US" (and similar) cultures

3 participants