What is the formula for leave encashment?

how we can calculate the number of working days in leave encashment?