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

NumericTextBox with unknown number of decimals

1 Answer 133 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Jack
Top achievements
Rank 1
Jack asked on 17 Dec 2015, 08:53 PM

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.

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 21 Dec 2015, 03:54 PM
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
Tags
NumericTextBox
Asked by
Jack
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or