Hi,
It looks like a great work is done in PCR.
You may have to check the ROUND operation for correct calculation.
You may also use PRINT to display the values for checking & analyse how the calculation is done. (If possible, show/explain the complete process of paying gratuity).
regards,
Bala.