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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL Round ???

Author  Topic 

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2007-03-28 : 13:27:30
trying to figure out how to round the following:

2179.1239999999998
want the number to be
2179.124

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-28 : 13:29:39
[code]select round(2179.1239999999998, 3)[/code]


KH

Go to Top of Page

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2007-03-28 : 13:41:26
thanks for the reponse, although I still get the same value back, the datatype of the column is a float.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-28 : 13:47:11


declare @f float
select @f = 2179.1239999999998

select convert(decimal(10,3), @f)



KH

Go to Top of Page

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2007-03-28 : 14:45:43
covert doesnt actually change data in the table does it? just the results?
Go to Top of Page

MohammedU
Posting Yak Master

145 Posts

Posted - 2007-03-28 : 14:52:11
Yes, convert will not change the data... it effect the results only...


MohammedU
Go to Top of Page

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2007-03-28 : 15:01:02
thanks for your help, that worked fine
Go to Top of Page
   

- Advertisement -