Mutual Fund Calculator
Compare SIP (systematic investment plan) vs lump sum returns with year-by-year growth projections.
Perguntas Frequentes
Implementação de Código
def lump_sum_future_value(principal: float, annual_rate: float, years: int) -> float:
"""Calculate future value of a lump sum investment."""
return principal * (1 + annual_rate / 100) ** years
def sip_future_value(monthly: float, annual_rate: float, years: int) -> float:
"""Calculate future value of SIP (Systematic Investment Plan)."""
r = annual_rate / 12 / 100 # monthly rate
n = years * 12 # total months
if r == 0:
return monthly * n
return monthly * ((1 + r) ** n - 1) / r * (1 + r)
# Example
principal = 100_000
monthly_sip = 5_000
annual_return = 12 # %
years = 10
ls_value = lump_sum_future_value(principal, annual_return, years)
sip_value = sip_future_value(monthly_sip, annual_return, years)
sip_invested = monthly_sip * 12 * years
print(f"Lump Sum: ₹{principal:,.0f} → ₹{ls_value:,.0f} (returns: ₹{ls_value-principal:,.0f})")
print(f"SIP: ₹{sip_invested:,.0f} invested → ₹{sip_value:,.0f} (returns: ₹{sip_value-sip_invested:,.0f})")Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.