I need to programmatically calculate APR based on the following inputs:
- Principal Amount
- Number of payments (for example, 3 months loan is 3 if paying monthly, or 6 bi-weekly payments)
- Payment each period
From this, I need the formula for APR.
Second, the customer may have an odd number of days before their first payment. I need to be able to plug this in as a variable in to calculation and get an adjusted APR.
Can someone help me with the formula for this?