Method Deck / finance
Compound interest
Computes the final amount of a principal that compounds periodically at a fixed nominal annual rate.
Published for review. The Founder is checking every card himself; anything he strikes comes down the same hour.
Try it
Inputs
- principal (number, currency units, required) min 0 : Starting amount
- annual_rate_percent (number, %, required) min 0 : Nominal annual rate
- compounds_per_year (integer, required) one of: 1, 2, 4, 12, 52, 365 : Compounding periods per year
- years (number, years, required) min 0 : Term
Outputs
- final_amount (currency units): Amount after the term
- interest_earned (currency units): Total interest earned over the term
Steps
- Convert the annual rate to a decimal: r = annual_rate_percent / 100.
- Periodic rate i = r / compounds_per_year; periods n = compounds_per_year * years.
- final_amount = principal * (1 + i) ^ n, rounded to 2 decimals.
- interest_earned = final_amount - principal, rounded to 2 decimals.
Constants
None.
Sources
- Principles of Corporate Finance (McGraw-Hill, 2026-09-30T19:31:29Z) - Standard compound interest formula FV = PV*(1+i)^n
Worked example and test vectors
| Name | Inputs | Answer |
| worked example | {"principal":1000,"annual_rate_percent":5,"compounds_per_year":12,"years":10} | $1,647.01 |
| test vector: annual compounding | {"principal":5000,"annual_rate_percent":4,"compounds_per_year":1,"years":5} | $6,083.26 |
Published card
- Address:
3e62459b4c99fb861413e2e0f5de0915
- Made at:
2026-09-30T22:39:30.722Z
- Method sha256:
b3e7f67052e07cf4aec7d6dc868531799f6dad8640cfbd5480c9b18d5b181d16