Round value only if it is greater than 5

Viewed 1694

I'm not sure that this is a duplicate question.

I need to ROUND a value only if the succeeding value is greater than 5.

For example:

If i have 123.4575, then the rounded value should be 123.457.

If i have 123.4576, then the rounded value should be 123.458.

But the default ROUND is not working as i'm expecting. See the below query,

select cast(round(123.4575, 3) as decimal(18,3))

Result:


123.458 (where it needs to be 123.457)

I need only three decimal points.

I prefer to suggest me some in-built functions rather than writing functions on my own.

Thanks.

1 Answers
Related