DECLARE @Test TABLE (Col NUMERIC(38,12));INSERT @Test (Col)SELECT 0,581183781439 UNION ALLSELECT 0,5815UNION ALLSELECT 0,581883781439UNION ALLSELECT -0,5814839,ColRO(Kol,VÆLG AS) 3) AS StandardRounding_3decimals, ROUND(Col, 3, 1) AS Truncation_3decimals, FLOOR(Col*1000)/1000 AS RoundDown_3decimals, CEILING(Col*1000)/1000 AS RoundUp_3decimals;
Resultater:
Col StandardRounding_3decimals Truncation_3decimals RoundDown_3decimals RoundUp_3decimals--------------------------------- ------------------ -------------------------- ---------- --------0.581183781439 0.581000000000 0.581000000000 0.581000 0.5820000.581500000000 0.582000000000 0.581000000000 0.581000 0.5820000.581883781439 0.582000000000 0.581000000000 0.581000 0.582000-0.581883781439 -0.582000000000 -0.581000000000 -0.582000 -0.581000