Files
calctext/_bmad-output/implementation-artifacts/6-4-financial-functions.md
2026-03-16 19:54:53 -04:00

50 lines
1.8 KiB
Markdown

---
epic: 6
story: 6.4
title: "Financial Functions"
status: draft
---
## Epic 6 — Advanced Math & Functions
**Goal:** Scientific, financial, and power-user math.
### Story 6.4: Financial Functions
As a **CalcPad user**,
I want to use natural-language financial expressions for compound interest and mortgage calculations,
So that I can quickly answer personal finance questions without looking up formulas.
**Acceptance Criteria:**
**Given** the user writes `$5000 after 3 years at 7.5%`
**When** the engine evaluates (compound interest, annual compounding by default)
**Then** the result is approximately `$6,211.94`
**Given** the user writes `mortgage $350000 at 6.5% for 30 years`
**When** the engine evaluates (standard monthly payment amortization)
**Then** the result is approximately `$2,212.24` per month
**Given** the user writes `$10000 after 5 years at 5% compounded monthly`
**When** the engine evaluates
**Then** the result is approximately `$12,833.59`
**Given** the user writes `mortgage $200000 at 4% for 15 years`
**When** the engine evaluates
**Then** the result is approximately `$1,479.38` per month
**Given** the user writes a compound interest expression with 0% interest
**When** the engine evaluates
**Then** the result equals the principal (no growth)
**Given** the user writes a mortgage expression with 0% interest
**When** the engine evaluates
**Then** the monthly payment is the principal divided by the total number of months
**Given** the user writes `$5000 after 0 years at 7.5%`
**When** the engine evaluates
**Then** the result is `$5,000` (the principal unchanged)
**Given** the user writes a financial expression with missing or invalid parameters (e.g., `mortgage at 5%`)
**When** the engine evaluates
**Then** an error is displayed indicating the required format or missing parameters