Custom calculations for mortgage rates on form
Working on a PDF form for a client that has a few fillable fields and the rest are auto calculated based off those entries. Calculating the down payment and loan amount based off the purchase price was easy, but I can't figure out the auto calculated APR and P&I based off the rate they input.
This is the formula from an Excel file they gave me for the 30 year P&I (I replaced the cells callouts with what I have the fields labeled—PurchasePrice & ThirtyYearRate).
=PurchasePrice*(((ThirtyYearRate*0.01/12)*(1+(ThirtyYearRate*0.01/12))^360)/((1+ ThirtyYearRate*0.01/12)^360-1))
After I get the P&I figured out, the APR field will be based off the P&I.
I've tried to do some reading online, but Javascript is above me. Any help would be greatly appreciated.