Advertisement

04.19.2008 at 02:07PM PDT, ID: 23337030
[x]
Attachment Details

Convert.ToDecimal rounding to whole number

Asked by mmexchange in Microsoft Visual C#.Net, MS SQL Server

Tags: C#

I'm taking a string number and need to write into SQL database.
Request.Form["amount"] ... is "22.85"
Convert.ToDecimal(Request.Form["amount"]) ... is "23"
I'm passing to SQL, using "SqlDbType.Decimal"
Within SQL db, field has data type of "decimal(12, 2)"
Why is this happening? What do I need to do?

Start Free Trial
[+][-]04.19.2008 at 03:14PM PDT, ID: 21394183

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.19.2008 at 03:21PM PDT, ID: 21394216

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, MS SQL Server
Tags: C#
Sign Up Now!
Solution Provided By: GreenGhost
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.19.2008 at 03:34PM PDT, ID: 21394276

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628