Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i am inserting a value like '121.93' into a field which of type decimal
but the problem is that it gets rounded off to a value like '122' which I dont want happening.

do you know how to fix this?
Posted
Updated 12-Jan-11 6:54am
v2

1 solution

Maybe you didn't correct configure the column. You have to specify the number of places to the right of the decimal, like this:

decimal(10,2) - ten digits, with two to the right of the decimal point.

EDIT ============

I'm curious. If this was "the" answer (which it looks like it was), why did you vote it a 4?
 
Share this answer
 
v2
Comments
gherard 12-Jan-11 13:33pm    
now i got it. properties/keyword in ms sql is scale and precision. tnx!
Аslam Iqbal 12-Jan-11 14:18pm    
nop my 5 here

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900