Numeric textbox changing value automatically to 10 000 000 000 000 000, 00 when enter 9 999 999 999 999 999, 99

4 posts, 0 answers
  1. Fady
    Fady avatar
    12 posts
    Member since:
    Jan 2015

    Posted 29 Dec 2015 Link to this post

    We are facing an issue with Kendo numeric textbox.

    In numeric textbox, when user tries to enter the value as “9 999 999 999 999 999, 99”, it automatically converts to “10 000 000 000 000 000, 00”.
    The converted value is passed to model also.
    We have an requirement to restrict user to allow enter values up to “9 999 999 999 999 999, 99”.

    Kindly check and provide your feedback.
  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 29 Dec 2015 Link to this post

    Hello Fady,

    The behavior that you are describing is related to the JavaScript Number object, used by the NumericTextBox, which loses precision after 16 digits. You can test the following simple scenario, which will demonstrate the same result:
    var number = -9999999999999999.99;
    alert(number);

    You could find detailed information on the Number object in the following link:

    Best Regards,
    Konstantin Dikov
    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
  4. Fady
    Fady avatar
    12 posts
    Member since:
    Jan 2015

    Posted 07 Jan in reply to Konstantin Dikov Link to this post

    Thanks for the reply.

     

    Is there any solution available to this issue?

  5. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 posts

    Posted 11 Jan Link to this post

    Hi Fady,

    Since the widget is using the JavaScript Number object, there is no workaround that could be used. The only thing that could be suggested for your requirement is to use a standard input that will allow the user to enter any string value that you could then handle manually.


    Regards,
    Konstantin Dikov
    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
Back to Top
UI for ASP.NET MVC is VS 2017 Ready