Subind
2009-06-04 12:32:29 UTC
Hi,
I'm facing issue with rounding of any float value. These are the two
ways I tried, both gave different results.
The method 1 doesn't do the rounding. why is that so?
Can anybody please throw some light on this issue?
Method 1
------------------------
declare @b float
select @b=2.135
select round(@b,2)
Result:2.13
Method 2
------------------------
select round(2.135,2)
Result:2.14
------------------------
I'm facing issue with rounding of any float value. These are the two
ways I tried, both gave different results.
The method 1 doesn't do the rounding. why is that so?
Can anybody please throw some light on this issue?
Method 1
------------------------
declare @b float
select @b=2.135
select round(@b,2)
Result:2.13
Method 2
------------------------
select round(2.135,2)
Result:2.14
------------------------