Skip to content

Instantly share code, notes, and snippets.

@cmaher
Created November 16, 2017 20:19
Show Gist options
  • Save cmaher/6fd5300c39348270c61f5f94cc8ea169 to your computer and use it in GitHub Desktop.
Save cmaher/6fd5300c39348270c61f5f94cc8ea169 to your computer and use it in GitHub Desktop.
savings equation
function savings(principal, rate, contributions, years) {
return (principal * ((1 + rate) ** years)) + (contributions * ((((1 + rate) ** years) - 1) / rate))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment