This is a migrated thread and some comments may be shown as answers.

Can we set this to integers instead of decimals?

1 Answer 29 Views
NumericBox
This is a migrated thread and some comments may be shown as answers.
John Strever
Top achievements
Rank 1
John Strever asked on 22 Aug 2016, 09:40 PM

For : <telerik:RadNumericBox

I'm trying to set this so it appears as a integer.

For example if one was using this RadNumericBox to represent people in your group    23.00  looks incorrect... it should be  23

 

I don't see a way to force an integer instead of decimal, how do you do that?

I notice there is a AcceptsDecimalSeperator="False" and I'm setting it so that users cant simply type in a part of a person :)

 

But how do you set this for integer?

1 Answer, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 24 Aug 2016, 06:27 PM
Hello John,

The RadNumericBox's Value property is of type double, you cannot change that. However, you can get the results you're looking for by setting the ValueFormat property. 

The RadNumericBox.ValueFormat property accepts a standard or custom string format. In your case, you want to use N0 format, which will display the value no decimal point.

For example:

<input:RadNumericBox ValueFormat="{}{0:N0}" Value="12"/>

Will give you this result:




You can read more about numeric string format here and see the rest of the RadNumericBox's properties and configurations here.

If you have any further trouble of have additional questions, please let us know. Thank you for contacting Support and for choosing Telerik by Progress.

Regards,
Lance | Tech Support Engineer, Sr.
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
NumericBox
Asked by
John Strever
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or