Crate cical

Source

Structs§

CompoundInterestParams
Represents the parameters for compound interest calculations
CompoundInterestResult
Represents the result of a compound interest calculation

Functions§

calculate_compound_interest
Calculate compound interest using the standard formula A = P(1 + r/n)^(nt) Where: A = Final amount P = Principal amount r = Annual interest rate n = Number of times interest is compounded per year t = Time in years
calculate_compound_interest_with_contributions
Calculate compound interest with regular contributions This uses the future value of annuity formula combined with compound interest
calculate_principal_for_target
Calculate the required principal to reach a target amount in given time
calculate_time_to_target
Calculate the time needed to reach a target amount
calculate_weekly_with_yearly_tax
Calculate compound interest with weekly contributions, weekly compounding, and yearly capital gains tax P = initial principal R = weekly rate (as decimal) weeks = number of weeks weekly_contribution = amount contributed each week capital_gains_tax = tax rate on profits (as decimal, e.g., 0.37 for 37%) Returns (final_amount_after_tax, total_interest_before_tax, total_tax_paid)
format_currency
Format currency values for display
format_percentage
Format percentage values for display
generate_breakdown
Generate a year-by-year breakdown of compound interest