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

RadNumericTextBox rounding

1 Answer 136 Views
Input
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 26 Jun 2009, 09:56 PM
I am using a RadNumericTextBox that needs to support up 5 digits before the decimal point and up to 15 digits (which i am planning on enforcing with an asp RegularExpressionValidator) after the decimal point (for example, 12345.123456789012345).  If I enter this number it gets rounded off to 12345.123456789011 when the control loses focus.

If I enter 0.123456789012345 it stays as 0.123456789012345 when the control loses focus which is the desired behavior.

This is the markup for the RadNumericTextBox

<

 

telerik:RadNumericTextBox ID="radTXTValue" runat="server" Width="500px"><NumberFormat DecimalDigits="15" AllowRounding="false" /></telerik:RadNumericTextBox>

 



Any help in resolving this will be appreciated.

John

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 30 Jun 2009, 01:15 PM
Hi John,

I am afraid that you have reached a limitation in the Javascript. Try this to see it:

parseFloat("12345.123456789012345") // will return 12345.123456789011

You can try using a different type of textbox (e.g. RadTextBox) and handle (validate, etc) the numbers with custom code client-side and/or server-side.

Greetings,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Input
Asked by
John
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or