You can do it both ways. See this
For Every completed year of service or part there of in excess of 6 months the employer shall pay gratuity to an employee at the rate of 15 days wages based on rate of wages last drawn by the employee concerned.
According to explanation under section 4(2), if the wages is paid monthly then the per day wage for the pupose of calculation of gratuity will be calculated as follows :-
Salary/Wages For Gratuity = Rate of Monthly Wage Last Drawn * 15 /26
In case of employee paid on piece rate basis, daily wages is computed as average of total wages received in a period of 3 months immediately preceding the date of termination. For this purpose, the wages paid for any overtime work shall not be taken into account.
In the case of an employee who is employed in a seasonal establishment and who is not so employed throughout the year, the employer shall pay the gratuity at the rate of seven days' wages for each season.
The amount of gratuity payable to an employee shall not exceed ten lakh rupees.
For complete see
Payment of Gratuity Act, Rules, Forms, Returns & All Other Information