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

RadNumericTextBox displays scientific notation on focus

2 Answers 114 Views
Input
This is a migrated thread and some comments may be shown as answers.
Zachary
Top achievements
Rank 1
Zachary asked on 17 Jul 2013, 07:25 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 22 Jul 2013, 05:15 PM
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.
0
Zachary
Top achievements
Rank 1
answered on 22 Jul 2013, 05:50 PM
The property seems to have functionality outside of keeping trailing zeros on focus, but this does resolve the issue for me.
Tags
Input
Asked by
Zachary
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Zachary
Top achievements
Rank 1
Share this question
or