Method Deck / finance

Amortized loan payment

Computes the fixed monthly payment for a fully amortizing loan using the standard annuity payment formula.

Published for review. The Founder is checking every card himself; anything he strikes comes down the same hour.

Try it

Inputs

Outputs

Steps

  1. Convert the annual rate to a decimal: r = annual_rate_percent / 100.
  2. Monthly rate i = r / 12.
  3. If i = 0, monthly_payment = principal / months.
  4. Otherwise, monthly_payment = principal * i * (1 + i)^months / ((1 + i)^months - 1) (the standard annuity payment formula).
  5. Round monthly_payment to 2 decimals (money to cents).

Constants

None.

Sources

Worked example and test vectors

NameInputsAnswer
worked example{"principal":200000,"annual_rate_percent":6,"months":360}$1,199.10
test vector: zero interest{"principal":12000,"annual_rate_percent":0,"months":12}$1,000.00

Published card