We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Change number of decimal places

Thread ID:

Created:

Updated:

Platform:

Replies:

142772 Feb 19,2019 11:00 AM UTC Mar 4,2019 06:13 AM UTC WinForms 5
loading
Tags: SfNumericTextBox
Barry
Asked On February 19, 2019 11:00 AM UTC

I am using Visual Studio 2017 (Visual Basic). I have added a number of SfNumericTextBox controls to a form but they default to 2 decimal places. How can I change the number of decimal places displayed?



Jagadeesan Pichaimuthu [Syncfusion]
Replied On February 19, 2019 11:28 AM UTC

Hi Barry, 

Thanks for using Syncfusion product. 

You can able to achieve your requirement by using the NumberFormatInfo property of the SfNumericTextBox control. If the FormatMode of the numeric textbox is Numeric then we can set the NumberDecimalDigits value to change the decimal places.  

//If the FormatMode is Numeric 
this.NumericTextBox.FormatMode = Syncfusion.WinForms.Input.Enums.FormatMode.Numeric; 

this.NumericTextBox.NumberFormatInfo = new System.Globalization.NumberFormatInfo() { NumberDecimalDigits = 4 }; 


// If the FormatMode is Currency 
this.CurrencyNumericTextBox.FormatMode = Syncfusion.WinForms.Input.Enums.FormatMode.Currency; 

this. CurrencyNumericTextBox.NumberFormatInfo = new System.Globalization.NumberFormatInfo() { CurrencyDecimalDigits = 4 }; 

// If the FormatMode is Percent 
this.PercentNumericTextBox.FormatMode = Syncfusion.WinForms.Input.Enums.FormatMode.Percent; 
this. PercentNumericTextBox.NumberFormatInfo = new System.Globalization.NumberFormatInfo() { PercentDecimalSeparator = 4 }; 

Please refer the below link to get more information about the formatting support in SfNumericTextBox control. 


Let us know whether this helps also if you need any further assistance on this. 

Regards, 
Jagadeesan 


Barry
Replied On February 20, 2019 10:20 AM UTC

This doesn't appear to be VB code.

Jagadeesan Pichaimuthu [Syncfusion]
Replied On February 20, 2019 10:28 AM UTC

Hi Barry, 

Sorry for the inconvenience caused.  

Now we have provided the VB code for your reference. So please find the VB code below, 

'If the FormatMode is Numeric  
Me.NumericTextBox.FormatMode = Syncfusion.WinForms.Input.Enums.FormatMode.Numeric 

Me.NumericTextBox.NumberFormatInfo = New System.Globalization.NumberFormatInfo() With {.NumberDecimalDigits = 4} 


' If the FormatMode is Currency  
Me.CurrencyNumericTextBox.FormatMode = Syncfusion.WinForms.Input.Enums.FormatMode.Currency 

Me.CurrencyNumericTextBox.NumberFormatInfo = New System.Globalization.NumberFormatInfo() With {.CurrencyDecimalDigits = 4} 

' If the FormatMode is Percent  
Me.PercentNumericTextBox.FormatMode = Syncfusion.WinForms.Input.Enums.FormatMode.Percent 

Me.PercentNumericTextBox.NumberFormatInfo = New System.Globalization.NumberFormatInfo() With {.PercentDecimalSeparator = 4} 

Please refer the below link to get more information about the formatting support in SfNumericTextBox control.  


Let us know whether this helps also if you need any further assistance on this. 

Regards, 
Jagadeesan

Barry
Replied On March 1, 2019 11:23 PM UTC

Thank you for your help. Everything is working great now!!

Jagadeesan Pichaimuthu [Syncfusion]
Replied On March 4, 2019 06:13 AM UTC

Hi Barry, 
 
Thanks for the update. 
 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
Jagadeesan

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon