Reduce default NumberBox precision to 6 digits#7851
Conversation
b11146f to
246b51f
Compare
246b51f to
f74ce26
Compare
| bool m_textUpdating{ false }; | ||
|
|
||
| winrt::SignificantDigitsNumberRounder m_displayRounder{}; | ||
| winrt::IncrementNumberRounder m_displayRounder{}; |
There was a problem hiding this comment.
I initially didn't consider how this would work with >1 integer digit. Switching to a IncrementNumberRounder ensures that it always formats it with 6 fractional digits no matter how many integer digits it has.
|
The team will only be taking critical changes into WinUI 2.8 as our current focus is to assist our users in moving from WinUI 2 to WinUI 3. This change did not meet the bar for a WinUI 2.8 servicing release, but is approved to merge into the WinUI 2 main branch for a WinUI 2.9. That being said, at this time, we have no plans for a WinUI 2.9 as we focus on advancing WinUI 3. We will also port this change to WinUI 3 and it will be present for applications that have migrated to WinUI 3 in an upcoming WinAppSDK release. Thank you for your contribution! cc: @bpulliam |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Description
printf() defaults to 6 digits. 6 digits are sufficient for most
users under most circumstances, while simultaneously avoiding most
rounding errors for instance during double/float conversion.
Closes #3959
Motivation and Context
FLT_DECIMAL_DIGis 9. With 12 significantly exceeding this,WinUI is incapable of presenting 32-bit floats. C defaults
to 6 digits for string conversions for this exact reason.
How Has This Been Tested?
Windows Terminal overrides its NumberBoxes the same way this PR does it.
Screenshots (if appropriate):
Before:

After:
