NumericTextBox for Large Values

6 posts, 2 answers
  1. Safira
    Safira avatar
    3 posts
    Member since:
    Apr 2013

    Posted 14 Jan 2014 Link to this post

    Hey guys,

    I'm using Kendo with MVC 3 and Html Helpers.

    I need to receive possible large currency values, up to 19 digits and 2 decimal places, always positive. I have used the Min and Max methods, but I am observing a very peculiar behavior. 

    For reproducing purposes the values I'm using are:
       Min()  - 0
       Max() -  9999999999999999999.99

    Behaviors:

    I write 17 digits 1's ( 11.111.111.111.111.111 ), after losing focus, the NumericTextBox shows me a random 2 instead of 1 at the end (  11.111.111.111.111.112 ).
    After that, it seems like any digit I input is being transformed and presented incorrectly. Some times the number presented, and the number that actually exists in the NumericTextBox are different (on edit mode, and view mode). The decimal place values are also transformed incorrectly after 

    At one point the value becomes ( 10.000.000.000.000.000.000 ), that is 20 digits with no decimal places. And I can't go above that, nor can I add any decimal place values to it.

    There seems to be a lot of issues with the NumericTextBox control to numbers with more than 15 digits. Is this a known bug? Am I doing something wrong. Any help would be extremely helpful.

    Thank you.




  2. Answer
    Safira
    Safira avatar
    3 posts
    Member since:
    Apr 2013

    Posted 16 Jan 2014 Link to this post

    Hello,

    The NumericTextBox uses JavaScript Number object, which looses precision after 16th digit. You can find more information about Number object here. In order to overcome this language limitation I would suggest you define the max value of the widget less then 16 digits number.

    Regards,
    Georgi Krustev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Safira
    Safira avatar
    3 posts
    Member since:
    Apr 2013

    Posted 16 Jan 2014 Link to this post

    Thank you for your quick reply.

    I understand the issue, but unfortunately, limiting the values to 16 digits is not an option.

    Do you have any other suggestion to try and overcome this issue? I'm sure I am not the first person to use large numeric values.

    Thank you again.
  5. Answer
    Safira
    Safira avatar
    3 posts
    Member since:
    Apr 2013

    Posted 16 Jan 2014 Link to this post

    Hello again,

    As this issue is directly related to the Number object limitation, the only workaround that I can suggest is to use a regular <input type="text" /> and a client validation. Thus longer text will be allowed and the client validation will help you to insure the validity of the user input.

    Regards,
    Georgi Krustev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Safira
    Safira avatar
    3 posts
    Member since:
    Apr 2013

    Posted 17 Jan 2014 Link to this post

    Thank you for your reply.

    Using a text control does seem to be the only option at this point. 

    I would like to create a ticket to have this issue resolved in future versions of Kendo if possible. And also I believe you should have this restriction in your documentation, even if it is a restriction on the javascript object.

    Thank you again for your support.
  7. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 17 Jan 2014 Link to this post

    Hello,

    We will document this limitation in order to avoid any misunderstandings. 

    You can open a discussion on the subject in our UserVoice portal. Thus we will able to gather community feedback.

    Regards,
    Georgi Krustev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready