RadNumericTextBox displays scientific notation on focus

3 posts, 1 answers
  1. Zachary
    Zachary avatar
    20 posts
    Member since:
    Aug 2012

    Posted 17 Jul 2013 Link to this post

    Background
    I am using a RadGrid with GridNumericColumns, but I can reproduce this using just a RadNumericTextbox on a page.

    Telerik.Web.UI.dll 2013.2.611.35.
    IE10, IE7, Chrome, Firefox

    Issue
    When entering a decimal value into a RadNumericTextbox, if there are no values greater than 0 to the left of the decimal point, and the first non-zero digit is seven digits to the right of the decimal point, the number will be displayed in the field in scientific notation on focus. 0.0000007 will be displayed as 7e-7 if the user enters the number, selects outside the textbox, and then selects the textbox again. I would like it to remain in standard decimal notation.

    Code

    <telerik:RadNumericTextBox ID="rntTest" runat="server" DataType="Decimal" NumberFormat-DecimalDigits="15">
    </telerik:RadNumericTextBox>

     

    Additional Notes
    The user in the previous thread seemed to be having an identical issue. Perhaps this bug has been reintroduced?
    Previous Issue

  2. Answer
    Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 22 Jul 2013 Link to this post

    Hello Zachary,

    RadNumericTextBox control will keep its zero numbers on focus if you set KeepTrailingZerosOnFocus property to true:
    <telerik:RadNumericTextBox ID="rntTest" runat="server" DataType="Decimal" NumberFormat-DecimalDigits="15">
                <NumberFormat KeepTrailingZerosOnFocus="true" />
            </telerik:RadNumericTextBox>

    Additionally for more information about formatting numeric values you can refer to the article below:
    http://www.telerik.com/help/aspnet-ajax/input-numerictextbox-formatting-numeric-values.html

    Regards,
    Pavlina
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Zachary
    Zachary avatar
    20 posts
    Member since:
    Aug 2012

    Posted 22 Jul 2013 Link to this post

    The property seems to have functionality outside of keeping trailing zeros on focus, but this does resolve the issue for me.
Back to Top