I’m using SQL Server 2005. And I’m using ROUND T-SQL function to round a decimal column value. But it seems that the rounded value is incorrect.
PRINT ROUND(1890.124854, 2) => 1890.120000
As shown the ROUND function is returning 1890.12 where as it should be 1890.13. Does anyone encountered this and what should be the correct way of rounding so that I get the expected value 1890.13..?
Thanks.
ROUND()is working as it was intended to. You specified to round to 2 decimal places, and that’s what you got.Rounding means that a digit of 5 or above goes up to nearest, less than 5 down to nearest.
so,
produces
1890.130000Whereas
produces
1890.120000