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

Numerictextbox values are getting changed after specific limit - More than 16 and 20

1 Answer 567 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
SHANMUGAM
Top achievements
Rank 1
SHANMUGAM asked on 15 Sep 2020, 07:33 AM

In Numeric Textbox when provide value more than 16 digits, Clicking outside the textbox, The number automatically gets incremented and decremented on different values

Another scenario when the provide value more than 20 digits, Clicking outside the textbox displays only one digit or different value

Do we have any solution/workaround to achieve this scenario?

1 Answer, 1 is accepted

Sort by
0
Georgi Denchev
Telerik team
answered on 16 Sep 2020, 01:40 PM

Hello, SHANMUGAM

The reason you cannot use more than 16 symbols in the NumericTextBox, is because the component works with the Number object.

Number has a MAX_SAFE_INTEGER value of 9,007,199,254,740,991 or 2^53 - 1.

Attempting to go beyond that could lead to loss in precision.

https://docs.telerik.com/kendo-ui/controls/editors/numerictextbox/limitations#persisted-number-of-decimals

If you're interested in more information regarding the topic, you can read here.

https://stackoverflow.com/a/54803254

This answer also has additional links, that you may find useful.

As for a workaround, you can use the regular TextBox Widget or even just a regular input field.

https://demos.telerik.com/kendo-ui/textbox/index

If you want to limit it to numbers only, you could use Regular Expressions to allow only [0-9] characters.

If I can assist you any further, feel free to reply in this thread.

 

Regards,
Georgi Denchev
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

Tags
NumericTextBox
Asked by
SHANMUGAM
Top achievements
Rank 1
Answers by
Georgi Denchev
Telerik team
Share this question
or