Yachi (ya***@pointel.it) writes:
3° decimal between 1 and 5 LOW
3° decimal between 6 and 9 UP
There is the round function:
select (87.983, 2)
However, the round() function will round 0.125 to 0.13, that is alwys
up. This may or may not be a problem for you, dependning on the input
source. If the input is decimal or money, they you need to write some
ugly UDF to deal with the special case. But if the input is float, the
issue is moot, because the likelihood that you will have a float value
which ends in xx500000000 is not that big. For instance:
declare @f, @g float
select @f = 0.135, @g = 0.145
select round(@f, 2), round(@g, 2) -- Both are 0.14
--
Erland Sommarskog, SQL Server MVP,
so****@algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp