Skip to content
Advertisement

How to truncate real, Money or decimal values in sybase database

I have a database function called:
dbo.cf_unpaid_interest_to_date

I ran the following:

enter image description here

I get: 13.639999

I want the value to be : 13.6300 instead of 13.639999

I tried floor but did not work.

Advertisement

Answer

If you want fixed number of decimals, use DECIMAL(precision, scale) datatype instead of REAL. With REAL you are bound to have rounding errors.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement