Can someone explain how leave encashment is calculated using greytHR?

How does greytHR calculate the amount paid to an employee for unused leave days?