đŸ› ïžToolsShed

Mutual Fund Calculator

Compare SIP (systematic investment plan) vs lump sum returns with year-by-year growth projections.

HĂ€ufig gestellte Fragen

Code-Implementierung

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.