Can we set this to integers instead of decimals?

2 posts, 0 answers
  1. John Strever
    John Strever avatar
    3 posts
    Member since:
    Mar 2005

    Posted 22 Aug 2016 Link to this post

    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?

  2. Lance | Tech Support Engineer, Sr.
    Lance | Tech Support Engineer, Sr. avatar
    457 posts

    Posted 24 Aug 2016 Link to this post

    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.

    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
Back to Top