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.
| 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.1239999999998want the number to be2179.124 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-28 : 13:29:39
|
[code]select round(2179.1239999999998, 3)[/code] KH |
 |
|
|
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. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-28 : 13:47:11
|
declare @f floatselect @f = 2179.1239999999998select convert(decimal(10,3), @f) KH |
 |
|
|
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? |
 |
|
|
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 |
 |
|
|
duhaas
Constraint Violating Yak Guru
310 Posts |
Posted - 2007-03-28 : 15:01:02
|
| thanks for your help, that worked fine |
 |
|
|
|
|
|