Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 No Rounding

Author  Topic 

Vack
Aged Yak Warrior

530 Posts

Posted - 2012-03-27 : 14:26:40
Is there a way to put a 3 decimal value into a field that is decimal(16,2) and not have it round?

I tried putting 35.155 into a field that is decimal(16,2) and it updated it to 35.16.

I wouldn't think this would be such a task. But every where I'm looking it seems like there is no real good solution for this???

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-03-27 : 14:29:42
Use the third parameter for the ROUND function: http://msdn.microsoft.com/en-us/library/ms175003.aspx

ROUND(35.1555,2,1)
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2012-03-27 : 14:49:46
yep. any non-zero value will work.
Go to Top of Page
   

- Advertisement -