RadNumericTextbox notation and rounding problems

4 posts, 0 answers
  1. Gilbert
    Gilbert avatar
    16 posts
    Member since:
    Jun 2009

    Posted 07 May 2010 Link to this post

    Hi,

    I'm using RadNumericTextbox up to 15 decimal places right now and having some formatting and rounding problems. When I enter a value like 0.0000000008 into the textbox when it loses focuses it turns into 8. When I put it back into focus it turns into 8e-10. At this point if I defocus the textbox the value turns into a permanent 8. Is there any way where I can make it show 0.0000000008 for all cases? I'm trying not to show the exponential notation and not have it show it as a whole number when it is actually a very small number.

    Also since numerictextbox uses double and goes up to 15 total digits I'm trying to truncate the excess digits rather than rounding it. e.g. 1.12345678901234567890 turns into 1.1234567890123457 on defocus and on postback it turns into 1.12345678901235. Is there any way to not get rounding for both these cases? This is what I have for my example:

    <telerik:RadNumericTextBox runat="server" ID="rntbTest" Width="100">  
                <NumberFormat DecimalDigits="15" KeepNotRoundedValue="false" AllowRounding="false" />  
    </telerik:RadNumericTextBox> 

    Thanks!
    Gilbert
  2. robertw102
    robertw102 avatar
    265 posts
    Member since:
    Jul 2007

    Posted 07 May 2010 Link to this post

    This post should be of use to you.


    Apparently, I don't believe what you want to do is possible with the RadNumericTextbox.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Gilbert
    Gilbert avatar
    16 posts
    Member since:
    Jun 2009

    Posted 07 May 2010 Link to this post

    Hi Robert,

    I have read that thread before posting this thread but I wanted to use NumericTextBox functions like spin button and have the values come back directly as double instead of string. I guess it's really the only option I can use now?

    Can RadInputManager manipulate the ASP textbox type to double? I can forgo the spin button but having it come back as double helps lessen the changes I have to make to change all the NumericTextBoxes to textboxes.

    Furthermore, when I get an validation error from RegExpTextBoxSetting (^[0-9]*$) the box turns red and blocks post back. Is there a way to still allow post back and have the textbox return an empty string without turning validation off for my buttons? In NumericTextbox when you enter a letter the box just flashes and blocks the character from input which is helpful.

    Thanks!
    Gilbert
  5. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 12 May 2010 Link to this post

    Hi Gilbert,

    As far as my observations go, RadNumericTextBox successfully manages to format the value 1.12345678901234567890. When it is blurred, the value is formatted to 1.123456789012345 with AllowRounding="False" and 15 dicimal digits. Testing with the latest version of RadControls 2010.Q1.415 (which you have indicated to be using).

    Greetings,
    Veli
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
Back to Top