Home > database >  Is there a way in T-SQL / SSMS to round interest rate values to the nearest eighth (0.125)?
Is there a way in T-SQL / SSMS to round interest rate values to the nearest eighth (0.125)?

Time:01-26

I need to round interest rates to the nearest eighth (0.125) in T-SQL.

I have found things like the following which will round to the nearest quarter or half, but nothing to the nearest eighth.

round(indexrate/25,2) * 25

Does anyone have any experience/solutions that they can share?

Thank you in advance for the help.

CodePudding user response:

How about this:

SELECT ROUND(indexrate * 8.0, 0) / 8.0

CodePudding user response:

SELECT ROUND(indexrate/-.125) FROM ....

  •  Tags:  
  • Related