Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RadnumericTextbox rounding issue

Tags:

c#

telerik

the code :

<telerik:RadNumericTextBox ShowSpinButtons="False"  DisplayText="Infinite" 
                  ID="MaximumAmount_tb" runat="server"  IncrementSettings-InterceptArrowKeys="true">
                <ClientEvents OnFocus="OnMAximumAmounttbFocus" />
                </telerik:RadNumericTextBox>

 function OnMAximumAmounttbFocus(sender, args) {
    //alert(sender.get_displayValue());
    if (sender.get_displayValue() == "Infinite") {
        sender.set_value("9,999,999,999,999.99999");

    }
    else
    {return false; }

}

i am always getting this number as a result on focus : 10000000000000 why ? and how can i fix my problem to display : 9999999999999.99999 ?

like image 872
Sora Avatar asked Apr 19 '13 11:04

Sora


1 Answers

As the documentation ( http://www.telerik.com/help/aspnet-ajax/input-numerictextbox-basics.html ) says, "RadNumericTextBox does not support maximum and minimum values with a greater magnitude than +/- 2^46." -- so it can basically contain about 14 significant digits. You're trying to set 18 significant digits, which is too much for it.

like image 165
C.B. Avatar answered Sep 20 '22 03:09

C.B.