Skip to content

Instantly share code, notes, and snippets.

@fnando
Created July 26, 2008 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fnando/2652 to your computer and use it in GitHub Desktop.
Save fnando/2652 to your computer and use it in GitHub Desktop.
# Created by Nando Vieira
# Usage: compound_interest(:amount => 1000, :interest => 0.1, :times => 5)
def compound_interest(options={})
options[:amount] * ((1 + options[:interest]) ** options[:times])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment