Calculateur d'Objectif d'Épargne
Calculez combien vous devez épargner chaque mois pour atteindre votre objectif financier.
La calculatrice d'objectif d'épargne vous aide à déterminer exactement combien vous devez épargner chaque mois pour atteindre un objectif financier à une date précise. Elle transforme votre objectif en un montant d'épargne mensuel concret et actionnable.
Entrez le montant cible, votre épargne actuelle, le taux de rendement annuel de votre compte d'épargne et la date cible. La calculatrice indique la contribution mensuelle requise et montre quelle part du solde final proviendra de vos contributions par rapport aux intérêts gagnés.
Vous pouvez également résoudre le problème à rebours : entrez le montant que vous pouvez épargner chaque mois et voyez combien de temps il faudra pour atteindre votre objectif.
Questions Fréquentes
Implémentation du Code
def monthly_savings_needed(
goal: float,
current_savings: float,
months: int,
annual_rate: float = 0
) -> float:
"""Calculate monthly deposit needed to reach a savings goal."""
if annual_rate == 0:
return (goal - current_savings) / months
r = annual_rate / 100 / 12 # monthly rate
fv_current = current_savings * (1 + r) ** months
remaining = goal - fv_current
if remaining <= 0:
return 0
pmt = remaining / (((1 + r) ** months - 1) / r)
return pmt
# Example: save $10,000 in 24 months with 4% annual interest
monthly = monthly_savings_needed(
goal=10000,
current_savings=1000,
months=24,
annual_rate=4
)
print(f"Monthly deposit needed: ${monthly:.2f}")
# Show total contributions vs interest earned
total_contributions = monthly * 24 + 1000
print(f"Total contributions: ${total_contributions:.2f}")
print(f"Interest earned: ${10000 - total_contributions:.2f}")Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.