Skip to content

force interpretation in XAML converter parameter parsing to use . d…#40

Merged
jhpohovey merged 1 commit into
mainfrom
johnpohovey/fix-locale-decimal-parsing
Mar 12, 2026
Merged

force interpretation in XAML converter parameter parsing to use . d…#40
jhpohovey merged 1 commit into
mainfrom
johnpohovey/fix-locale-decimal-parsing

Conversation

@jhpohovey

Copy link
Copy Markdown
Member

For language / region locale where . is not used for decimal like in 100.0 versus 100,0, causing a formatting error.

Also, should fix a silent error for regions where . is used for thousands place (meaning 100.0 may be interpreted as 1000).

Should fix #38

@jhpohovey jhpohovey marked this pull request as ready for review March 12, 2026 18:13
Copilot AI review requested due to automatic review settings March 12, 2026 18:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes locale-dependent parsing of numeric ConverterParameter values in WPF converters by forcing invariant-culture parsing, preventing crashes and incorrect scaling/opacity when the user’s locale doesn’t use . as the decimal separator (Issue #38).

Changes:

  • Parse DoubleScalingConverter’s ConverterParameter using CultureInfo.InvariantCulture in both Convert and ConvertBack.
  • Parse ColorBrushOpacityConverter’s opacity ConverterParameter using CultureInfo.InvariantCulture.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jhpohovey jhpohovey requested a review from ivberg March 12, 2026 18:19
@jhpohovey jhpohovey enabled auto-merge (squash) March 12, 2026 18:25
@jhpohovey jhpohovey merged commit de1641f into main Mar 12, 2026
10 checks passed
@jhpohovey jhpohovey deleted the johnpohovey/fix-locale-decimal-parsing branch March 12, 2026 22:05
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.

Clicking the Record button or opening a trace leads to an exception and program closes.

3 participants