I need a function to give me a rate.
I give the function m,i,r,p,t,a
m = monthly payment
i = interest rate used to get the monthly payment
r = residual
t = term in months
e = boolean, true = payemt at start of period, false = at end
File included shows what I've done so far and what I expect. What it doesn't do right now is the e (end or start of period).
You'll also need to modify the calc_payment method to include e.