1.Total days Service = Last date service - Joining date
2.Gratuity Days=Total days of services/365*21
3.Paid = Basic salary x 12/365 x Gratuity Days.

Hope you will Get accurate End of service Pay.