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. Image for the cookie policy date
close icon

SfNumericUpDown: how to edit integer values without showing decimal digits

I am using the SfNumericUpDown in a UWP application where it is 2-way bound to an integer property on a view model.

Although the control edits and persists the bound value correctly, it displays 2 decimal places of precision, which seems wrong for an integer value.

I have tried the following, with no success:

- setting the FormatString property to D, which causes a crash. 
- setting the MaximumNumberDecimalDigits property to 0, which has no effect.
- setting the ParsingMode property to both Decimal and Double, neither of which solves the problem

For comparison, this problem does not exist in the Xamarin.Forms version of the control.

Can you please advise what I can do to solve this?

Thanks,
Tim

3 Replies

AK Ashok Kumar Murugesan Syncfusion Team July 1, 2016 12:25 PM UTC

Hi Tim,

Thank you for contacting Syncfusion Support.

We have used the double type as Value in SfNumericUpDown. So it will display the Value with Decimal digits. We can display the Value without decimal digits by setting the FormatString property as "N0" and MaximumNumberDecimalDigits as "0". We have prepared the sample that tries to meet your requirement. In this sample, we have set the FormatString property as "N0" and MaximumNumberDecimalDigits as "0". Please download the sample from the following link.

Sample:SfNumericUpDown

Regards,
Ashok Kumar M.



NB Neil Bleakley February 6, 2017 10:00 PM UTC

How is this done on iOS as the method used here works fine on UWP but within iOS it displays a N0 when using the buttons which are also not rendered properly.


SK Selva Kumar  Veerakrishnan Syncfusion Team February 7, 2017 02:18 PM UTC

Hi Neil, 

Thank you for contacting Syncfusion support. 

Query: FormatString property in ios. 
We have modified the attached sample as per your requirement. We have only four FormatString property “c”, “p”, “n”, and custom format. If you use FormatString=”NO” it will take it as a custom FormatString and it will be in the suffix to the SfNumericUpDown number. We have changed this in the below given sample.  So, please download the program from below given link. 
 
Please let us know whether the given sample solves your query. 
 
Regards, 
Selvakumar V 


Loader.
Live Chat Icon For mobile
Up arrow icon