Solved

# calculation

Posted on 2006-05-31

I am trying to get the below amortization calculation to work for a mortgage program. The mortgage payment calculation works fine but i get an error on variable when i go to create the amortization schedule. is something wrong??

double newRate = rateValue / 100;

double J = newRate / 12;

//double moInC=(newRate*12)/100;

// to display amount in correct format

DecimalFormat df = new DecimalFormat("$#,###.00");

double mortgage = (Math.pow((1 + J), termValue) - 1)

/ (J * Math.pow((1 + J), termValue));

double payment = amountValue / mortgage; // *Rate Calculation

gui.paymtField.setText("" + df.format(payment));

}

/*double newPrinC = amountValue; <------------------this is the amortization that does not work.

{

for (int i = 0; i <= 480; i++)

{

double newInC = J * newPrinC;

double reductionC = payment - newInC;

newPrinC = newPrinC - reductionC;

gui.textField.append("");

gui.textField.append(" " + +i);

gui.textField.append(" " + "\t" + df.format(newInC));

gui.textField.append(" " + "\t" + df.format(reductionC));

gui.textField.append(" " + "\t" + df.format(newPrinC) + "\n");

}

}//*/