Question

I have a following issue with rounding.

SQL Server 2005

SELECT ROUND(82.05,1) AS [Round Amount]

Result
[82.10]

SELECT ROUND(82.07,1) AS [Round Amount]
Result
[82.10]

How do I customize the rounding function as the below pic?

enter image description here

Was it helpful?

Solution

SELECT ROUND(82.01*2,1)/2 AS [Round Amount]
82.00
SELECT ROUND(82.02*2,1)/2 AS [Round Amount]
82.00
SELECT ROUND(82.03*2,1)/2 AS [Round Amount]
82.05
SELECT ROUND(82.04*2,1)/2 AS [Round Amount]
82.05
SELECT ROUND(82.05*2,1)/2 AS [Round Amount]
82.05
SELECT ROUND(82.06*2,1)/2 AS [Round Amount]
82.05
SELECT ROUND(82.07*2,1)/2 AS [Round Amount]
82.05
SELECT ROUND(82.08*2,1)/2 AS [Round Amount]
82.10
SELECT ROUND(82.09*2,1)/2 AS [Round Amount]
82.10
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top