Formula 1.0.0

hirondelle.formula.function.builtin
Class Investment

Object
  extended by hirondelle.formula.function.builtin.Investment
All Implemented Interfaces:
Function

public final class Investment
extends Object
implements Function

invest(principal, interest-rate, years, times-per-year): compound interest on an investment.


Constructor Summary
Investment()
           
 
Method Summary
 Decimal calculate(Decimal... aArgs)
          Returns the final value of a principal amount invested at a given interest rate, and over a given number of years.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Investment

public Investment()
Method Detail

calculate

public Decimal calculate(Decimal... aArgs)
Returns the final value of a principal amount invested at a given interest rate, and over a given number of years. The result may have more than two decimal places.

There are 4 arguments to this method (in this order):

Example:

Then

invest(100, 0.05, 2, 1) = 110.25

Specified by:
calculate in interface Function
Parameters:
aArgs - 0 or more arguments to the function.

Formula 1.0.0

Copyright Hirondelle Systems. Published January 31, 2013