Rounding decimal in sql server
Is it possible to round downward with SQL server 2008?
E.g. .96855
is roun开发者_JAVA技巧ded to .968
.
I.e. up to .96899 I want to round .96899 by avoiding rest.
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)
cast(round(0.96855, 3, 1) as decimal(10,3))
Could this help?
SELECT ROUND(123.9994, 3)
Results: 123.9990
SELECT ROUND(123.9995, 3)
Results: 124.0000
精彩评论