Gratuity and Leave salary

How to make the calculation for Gratuity and leave Salary??