The Formula Behind Payment Calculations