NumericTextBox with unknown number of decimals

2 posts, 0 answers
  1. Jack
    Jack avatar
    1 posts
    Member since:
    Dec 2015

    Posted 17 Dec 2015 Link to this post

    Hi there,

    I'm using a NumericTextBox to edit a number with variable (unknown) number of decimals but I don't know how to show all the decimals because by default the NumericTextbox is rounding the number to two decimals.

    To partially solve the solution I did the following

    1.html.Kendo().NumericTextBox()
    2.    .Name("asdf")
    3.    .Format("#.#############")
    4.    .Decimals(10)

    But in this way I'm limiting the number of decimals to 10.

    Is there a way to show all the decimals in the NumericTextBox?

    Thank you,

    Jack.

  2. Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    347 posts

    Posted 21 Dec 2015 Link to this post

    Hello Jack,

    You can show up to 20 decimals using the .Decimals(20) method with the corresponding .Format("#.####################") method. 20 is the maximum possible decimal precision and the limitation is imposed by the JavaScript's toFixed() method.

    I hope this helps.

    Regards,
    Dimiter Topalov
    Telerik
    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
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top