The formula is: accrual * total calendar days worked in the cycle the employee was terminated / total calendar days in the cycle.
For example an employee was terminated today 27/02 (annual cycle Jan - December) with 20 days annual leave:
20 * 58 /365 = ±3.18 days