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

NumberBox and Decimals #8780

Closed
tkillingerAlro opened this issue Aug 15, 2023 · 2 comments
Closed

NumberBox and Decimals #8780

tkillingerAlro opened this issue Aug 15, 2023 · 2 comments
Labels
area-NumberBox NumberBox Control bug Something isn't working closed-Fixed Described behavior has been fixed. fix-released The fix has been in a release (experimental, preview, stable, or servicing). Regression team-Controls Issue for the Controls team
Milestone

Comments

@tkillingerAlro
Copy link

Describe the bug

Certain values cause rounding errors when the control is unfocused.
Examples of values that cause this behavior.
25.8, .0001, 294.1, 2924.8

WinUI.3.Gallery.2023-08-15.08-30-21.mp4

Steps to reproduce the bug

  1. Open up the WinUI 3 Gallery that is available on the Microsoft Store
  2. Navigate to numberbox
  3. Enter 25.8 and focus on another control

Expected behavior

Numbers do not change and stay the same.

Screenshots

No response

NuGet package version

Windows App SDK 1.3.2: 1.3.230602002

Packaging type

No response

Windows version

No response

IDE

No response

Additional context

This seems to be across multiple versions of the Windows App SDK.

@bpulliam bpulliam transferred this issue from microsoft/WindowsAppSDK Aug 24, 2023
@bpulliam bpulliam added area-NumberBox NumberBox Control team-Controls Issue for the Controls team labels Aug 24, 2023
@tkillingerAlro
Copy link
Author

Any Update on this?

I can confirm Win UI 2 does not have this issue. Also curious as to why this doesn't have the bug label as I'm sure this is not intended behavior.

@TroelsL
Copy link

TroelsL commented Oct 10, 2023

We also observe this bug. And it renders the NumberBox unusable. We tried looking for workarounds, but (somewhat ironically), using a DecimalFormatter with an IncrementNumberRounder does not seem possible as we are unable to set the Increment to 0.0001. This will throw an exception due the setter throwing an System.ArgumentException: 'The parameter is incorrect.' because somewhere 0.0001 gets converted to 9.9999997473787516E-05, which doesn't match the rules specified here:

https://learn.microsoft.com/en-us/uwp/api/windows.globalization.numberformatting.incrementnumberrounder.increment?view=winrt-22621#windows-globalization-numberformatting-incrementnumberrounder-increment

@duncanmacmichael duncanmacmichael added the bug Something isn't working label Oct 23, 2023
@llongley llongley closed this as completed Feb 9, 2024
@llongley llongley added the closed-Fixed Described behavior has been fixed. label Feb 9, 2024
@codendone codendone added this to the WinAppSDK 1.6 milestone Feb 27, 2024
@codendone codendone added the fix-released The fix has been in a release (experimental, preview, stable, or servicing). label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NumberBox NumberBox Control bug Something isn't working closed-Fixed Described behavior has been fixed. fix-released The fix has been in a release (experimental, preview, stable, or servicing). Regression team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

7 participants