Decimal Digits in Xamarin Numeric Entry (SfNumericTextBox)
21 Jul 20211 minute to read
Set Maximum Number of Decimal Digits in Xamarin Numeric Entry
The maximum number of digits to be displayed after the decimal point can be specified by using the MaximumNumberDecimalDigits
property.
NOTE
The
MaximumNumberDecimalDigits
property can be provided with positive value only.
<syncfusion:SfNumericTextBox x:Name="numericTextBox" Value="123.456" MaximumNumberDecimalDigits="2" />
SfNumericTextBox numericTextBox=new SfNumericTextBox();
numericTextBox.Value = 123.456;
numericTextBox.MaximumNumberDecimalDigits=2;
this.Content = numericTextBox;
Remove Default Decimal Digits in Xamarin Numeric Entry
Based on the MaximumNumberDecimalDigits
property, the default number of decimal digits is displayed. By disabling the AllowDefaultDecimalDigits
Boolean property, those default digits can be removed from the numeric entry view.
<syncfusion:SfNumericTextBox x:Name="numericTextBox" Value="123" AllowDefaultDecimalDigits="False" MaximumNumberDecimalDigits="2" />
SfNumericTextBox numericTextBox = new SfNumericTextBox();
numericTextBox.Value = 123;
numericTextBox.MaximumNumberDecimalDigits = 2;
numericTextBox.AllowDefaultDecimalDigits = false;
this.Content = numericTextBox;