Skip to content

fix(controls): Re-format NumberBox on MaxDecimalPlaces change#1737

Closed
Bintel wants to merge 1 commit into
lepoco:mainfrom
Bintel:patch-1
Closed

fix(controls): Re-format NumberBox on MaxDecimalPlaces change#1737
Bintel wants to merge 1 commit into
lepoco:mainfrom
Bintel:patch-1

Conversation

@Bintel

@Bintel Bintel commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

MaxDecimalPlaces on NumberBox has no PropertyChangedCallback. Changing it at runtime has no effect on the displayed text — the text only re-formats when Value changes.

What is the new behavior?

MaxDecimalPlacesProperty registers an OnMaxDecimalPlacesChanged callback that calls the existing private UpdateTextToValue() helper, re-formatting the display via NumberFormatter.FormatDouble(Math.Round((double)Value, MaxDecimalPlaces)) whenever MaxDecimalPlaces changes. Follows the same pattern as OnValueChanged and OnNumberFormatterChanged.

Other information

@Bintel Bintel requested a review from pomianowski as a code owner June 27, 2026 03:07
@github-actions github-actions Bot added controls Changes to the appearance or logic of custom controls. PR Pull request dotnet release labels Jun 27, 2026
@Bintel Bintel closed this Jun 27, 2026
@Bintel Bintel deleted the patch-1 branch June 27, 2026 03:31
@Bintel Bintel restored the patch-1 branch June 27, 2026 03:32
@Bintel Bintel deleted the patch-1 branch June 27, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

controls Changes to the appearance or logic of custom controls. dotnet PR Pull request release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant