Android 如何将Integer.parseInt()更改为十进制数?
刚才谁发布了答案?谢谢你,因为我已经解决了这个问题。再次感谢。如果您解决了问题,请发布您的答案,以便其他人受益。Android 如何将Integer.parseInt()更改为十进制数?,android,Android,刚才谁发布了答案?谢谢你,因为我已经解决了这个问题。再次感谢。如果您解决了问题,请发布您的答案,以便其他人受益。 public void showLoanPayments(View clickedButton) { double loanAmount = Integer.(mLoanAmount.getText().toString()); double interestRate = (Integer.parseInt(mInterestRate.get
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));
}
}