MudSlider: Fix tick count calculation for certain cases. Fixes #8713#8730
MudSlider: Fix tick count calculation for certain cases. Fixes #8713#8730henon merged 1 commit intoMudBlazor:devfrom
Conversation
Used ToDecimal instead of ToDouble because for certain values the double/int math would have rounding errors. Fixes MudBlazor#8713
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #8730 +/- ##
==========================================
+ Coverage 89.82% 90.07% +0.24%
==========================================
Files 412 418 +6
Lines 11878 12050 +172
Branches 2364 2366 +2
==========================================
+ Hits 10670 10854 +184
+ Misses 681 661 -20
- Partials 527 535 +8 ☔ View full report in Codecov by Sentry. |
|
Hi. |
I do not believe so. That just calculates the width of the component. I just tried a similar fix to the In my testing for this pr I had a value like 2.999999999987 and it went to 2 because of the int. But in this case 2.999999999987 would be rounded to 3 and not truncated to 2. |
|
Thanks! |
Description
Used ToDecimal instead of ToDouble because for certain values the double/int math would have rounding errors (see related issue for details). Fixes #8713
How Has This Been Tested?
Visually tested on docs.
Type of Changes
Before:

After:

Checklist
dev).