This simple loan calculator is provided for your convenience. This will allow you to
explore different interest rates, loan amounts, and mortgage term in order to estimate
your monthly payment. As an added plus, you can also view an amortization schedule of your potential
loan. This loan calculator should be used only as an estimation as it doesn't allow for taxes and insurance.
");
doc.write("
Payment #
Balance Owned Before Payment
Interest Paid
Principal Paid
Cumulative Interest Paid
Payment
Cumulative Payment
");
var cumreal = 0;
var cumpay = 0;
var interest = 0;
var defint = 0;
var num = 1;
while(balance > 0){
interest = balance * rate;
principal = payment - interest;
if(principal < 0){alert("There are errors in this form.");return;}
if(principal > balance-0.01) principal = balance;
cumreal = cumreal + interest;
realpay = principal + interest;
cumpay = cumpay + realpay;
doc.write("