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

RadNumericTextbox decimal interpretation

2 Answers 159 Views
Input
This is a migrated thread and some comments may be shown as answers.
Teck
Top achievements
Rank 1
Teck asked on 06 Mar 2012, 08:25 AM
Hi,

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

Sort by
0
Milena
Telerik team
answered on 09 Mar 2012, 10:56 AM
Hello,

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,
Milena
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.
0
JAIME
Top achievements
Rank 1
answered on 25 Jul 2014, 02:53 PM
try with Replace(Convert.ToDecimal(Eval("PriceInclTax")),",",".")
Tags
Input
Asked by
Teck
Top achievements
Rank 1
Answers by
Milena
Telerik team
JAIME
Top achievements
Rank 1
Share this question
or