Nithesh Narayanan
Nithesh Narayanan

Reputation: 11765

Rounding decimal in sql server

Is it possible to round downward with SQL server 2008? E.g. .96855 is rounded to .968.

I.e. up to .96899 I want to round .96899 by avoiding rest.

Upvotes: 5

Views: 18968

Answers (3)

Velu
Velu

Reputation: 181

cast(round(0.96855, 3, 1) as decimal(10,3))

Upvotes: 2

Xavinou
Xavinou

Reputation: 802

SELECT round(0.96855, 3, 1)

-> 0.96800

For 0.968 : cast(round(0.96855, 3, 1) as decimal(10,3)) works fine.

Ref: Round (if last param to Round is anything other than zero, it truncates)

Upvotes: 14

CloudyMarble
CloudyMarble

Reputation: 37566

Could this help?

SELECT ROUND(123.9994, 3)    
Results: 123.9990  


SELECT ROUND(123.9995, 3)    
Results: 124.0000   

Upvotes: 2

Related Questions