Posted 2 December 2024, 9:18 pm EST
Hi
There appears to be an issue when formatting with a % and the C1NumericBox
The following will show 3% as 300%.
Also, changing the binding to not multiply and divide by 100 will also show 3% as 300%.
IMO this is because the Format string applies on the get side of things, but not on the set side of things.
If you unbalance the get and the set with bind-Value to try and compensate for the format string, it ends up in a loop until the value reaches 0, and also does not work.
<C1NumericBox
ButtonDisplayMode="@ButtonDisplayMode.None"
Format="#,##0.0%"
Style="@(new C1Style(){ Width = 150 })"
TNumeric="decimal?"
@bind-Value:get="@(Shift.ShiftFeeRate.HasValue ? Shift.ShiftFeeRate * 100 : (decimal?)null)"
@bind-Value:set="(value) => Shift.ShiftFeeRate = value.HasValue ? value / 100 : null">
</C1NumericBox>
Hope that makes sense. Please advise.