Created
July 26, 2008 13:26
-
-
Save fnando/2652 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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