I have seen a few computations done in interbase and a lot of them have trailing decimals after them and if we want to round them manually, this is what I have come up with.
Suggestions and alternative solutions are always welcome. I am using a few variables so I can see the results of the computation as they unravel.
/* 889.125 */
VINT1 = (PANNUAL_TAX * 100);
VAMT1 = (VINT1 / 100);
VINT2 = (PANNUAL_TAX - VAMT1) * 1000;
VAMT2 = VINT2;
IF (VAMT2 >= 50) THEN
VAMT3 = VAMT1 + 0.01;
ELSE VAMT3 = VAMT1;
PANNUAL_TAX = VAMT3;
The PANNUAL_TAX is the variable that holds the 2 decimal result.
Enjoy,
Coffee Cup