# Rounding of SMALLMONEY Data Type in SQL Server 2005

I'm on SQL Server 2005, and I am trying to figure out a rounding issue with smallmoney data types.

For example, the value 1.2849, when rounded to 2 decimal places, produces 1.28, but shouldn't it produce 1.29? e.g. 9 rounds up for 1.285, 5 rounds up for 1.29.

Here is the example:

``````SELECT
'CAST(1.2849 AS SMALLMONEY)' OPERATION, CAST(1.284948 AS SMALLMONEY) RESULT
UNION
SELECT
'ROUND(CAST(1.2849 AS SMALLMONEY), 2)', ROUND(CAST(1.284948 AS SMALLMONEY), 2)
UNION
SELECT
'ROUND(ROUND(CAST(1.2849 AS SMALLMONEY), 3), 2)', ROUND(ROUND(CAST(1.2849 AS SMALLMONEY), 3), 2)
``````

## 1 Answer

I am fairly certain that it just looks at the third decimal digit... and that's 4 so it rounds down to 1.28.

Clarify - it looks to the digit one greater than what you are rounding to... so it looks to the third because you are rounding to the second.

• I concur. The laws of math make it clear that rounding in this instance should go down, not up. Mar 22, 2012 at 16:00
• Got it... so you are saying that it is behaving in a mathematically correct way, right?
– GWR
Mar 22, 2012 at 16:01
• Yep. It's mathematically correct!
– JHFB
Mar 22, 2012 at 16:05
• @cbwdev: Yes, it's closer to `1.28` than to `1.29` Mar 22, 2012 at 16:06