You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the RadNumericBox control for UWP with the following ValueFormat
ValueFormat="{}{0,0:#,##0.##}"
i.e. with two decimal places. The control correctly displays the current value after editing (i.e. when the control looses focus). However, the control internally seems to maintain the actual value entered, which might have more than the number of decimal places specified by the ValueFormat. Is there any possibility to limit the number of decimal places for the control regardless of the editing mode?
Any help appreciated!
P.S.: I'm using the latest version of the Telerik.UI.for.UniversalWindowsPlatform NuGet package (v1.0.1)
The text was updated successfully, but these errors were encountered:
@ManuLin If you want your value to be limited to a specific number of decimal places you can bind the Value property to a Value inside a ViewModel and inside the setter to round it as desired: private double numericValue; public double NumericValue { get { return this.numericValue; } set { if (this.numericValue != value) { value = Math.Round(value, 2); this.numericValue = value; this.OnPropertyChanged(nameof(this.NumericValue)); } } }
and in XAML: <input:RadNumericBox Value="{Binding NumericValue, Mode=TwoWay}" ValueFormat="{}{0,0:#,##0.##}"/>
I'm using the RadNumericBox control for UWP with the following ValueFormat
ValueFormat="{}{0,0:#,##0.##}"
i.e. with two decimal places. The control correctly displays the current value after editing (i.e. when the control looses focus). However, the control internally seems to maintain the actual value entered, which might have more than the number of decimal places specified by the ValueFormat. Is there any possibility to limit the number of decimal places for the control regardless of the editing mode?
Any help appreciated!
P.S.: I'm using the latest version of the Telerik.UI.for.UniversalWindowsPlatform NuGet package (v1.0.1)
The text was updated successfully, but these errors were encountered: