public void showLoanPayments(View clickedButton) {
double loanAmount = Integer.(mLoanAmount.getText().toString());
double interestRate = (Integer.parseInt(mInterestRate.getText().toString()));
double loanPeriod = Integer.parseInt(mLoanPeriod.getText().toString());
double r = interestRate/1200;
double r1 = Math.pow(r+1,loanPeriod);
double monthlyPayment = (double) ((r+(r/(r1-1))) * loanAmount);
double totalPayment = monthlyPayment * loanPeriod;
mMonthlyPaymentResult.setText(new DecimalFormat("##.##").format(monthlyPayment));
mTotalPaymentsResult.setText(new DecimalFormat("##.##").format(totalPayment));
}
}
答案 0 :(得分:0)
刚刚发布答案的人?谢谢你,因为我已经解决了这个问题。再次感谢。