RadNumericTextbox decimal interpretation

3 posts, 0 answers
  1. Teck
    Teck avatar
    4 posts
    Member since:
    Oct 2012

    Posted 06 Mar 2012 Link to this post


    I am using a RadNumericTextbox in a DetailsView control to display a decimal value coming from a SQL query.
    The original value from the database is "23,3000" with decimal type.
    When displayed in a conventional ASP Textbox, the value is correctly displayed, even when I use:
    Text='<%# Convert.ToDecimal(Eval("PriceInclTax")) %>'

    When I pass exactly the same value to the RadNumericTextbox, I always get the value "233000" as an integer.

    I am using the following code in aspx:


    <telerik:RadNumericTextBox ID="PriceInclTaxTextBox" runat="server" Value='<%# Convert.ToDecimal(Eval("PriceInclTax")) %>' NumberFormat-DecimalDigits="4"></telerik:RadNumericTextBox>

    I tried to change the Culture, NumberFormat-DecimalDigits, NumberFormat-GroupSeparator, NumberFormat-DecimalSeparator and Datatype parameters but with no luck. Another aproach was to divide the result by 10000, but only dividing by 1000 is showing the "comma" in the original value as "233,0000". Dividing by 10000 has the same result as dividing by 1000.
    Any help?
  2. Milena
    Milena avatar
    223 posts

    Posted 09 Mar 2012 Link to this post


    I tried to reproduce the described issue, but no avail. Attached, you can find the project, which I used for testing(I set a culture in text box declaration to use the same decimal separator as you ). Please, try to modify the project in order to replicate the problem on it and let me know what I am missing out.

    Kind regards,
    the Telerik team
    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 their blog feed now.
  3. DevCraft R3 2016 release webinar banner
  4. JAIME
    JAIME  avatar
    1 posts
    Member since:
    Feb 2014

    Posted 25 Jul 2014 in reply to Teck Link to this post

    try with Replace(Convert.ToDecimal(Eval("PriceInclTax")),",",".")
Back to Top