2 things:
Note: done with v9
1 - Payment and payment 2 both give a close payment, but after checking all my figures against Giants for payment accuracy, found the afore mentioned functions to be lacking in accuracy.
2. I modified my function from above and am giving another function to replace the 2 payment functions in alpha5.
If you run a payment on 10637.45 at 10% interest and you will get 343.24, but if you use the payment/payment2 functions, you will get 343.25. some other payments are as much as .02 cents off. Check this against Reynolds & Reynolds and others to see which is correct 343.24 is correct! They are probably all legal, but may not pass a bank for cashing a contract.
Any suggestions or comment are welcome.
Note: done with v9
1 - Payment and payment 2 both give a close payment, but after checking all my figures against Giants for payment accuracy, found the afore mentioned functions to be lacking in accuracy.
2. I modified my function from above and am giving another function to replace the 2 payment functions in alpha5.
If you run a payment on 10637.45 at 10% interest and you will get 343.24, but if you use the payment/payment2 functions, you will get 343.25. some other payments are as much as .02 cents off. Check this against Reynolds & Reynolds and others to see which is correct 343.24 is correct! They are probably all legal, but may not pass a bank for cashing a contract.
Code:
'accurate function for the payment. FUNCTION pmts1 AS N (pri as n,rte as n,trm as n) dim years as n dim peryear as n dim t as n dim n as n dim N as n dim r as n dim R as n dim P as n years = trm/12 peryear = 12 t = years n = peryear N = n*t r = rte/100 R = r/n P = pri dim a as n dim b as n R=(rte/100)/peryear a=P*R*((1+R)^N) b=(1+R)^N-1 pmts1 = round(a/b,2) END FUNCTION ' gets payments for other than 30 days to first. ' calls pmts1 function above. FUNCTION pmtonapr AS N (p as n, r as n, mos as n, type as n, daystofirst as n) if daystofirst = 30 then pmtonapr =round(pmts1(p,r,mos),2) goto END else goto NEXT1 end if NEXT1: dim rte as n = (r/100)/12 df = round_UP((daystofirst-30)/30,6) dim trm as n = 0 dim formu as n dim factor as n factor = round_up((rte*df)*p,8)'round_down((rte*df)*p,8) formu = round_up(p+factor,5) pmtonapr = round_down(pmts1(formu,r,mos),2) END:
Comment