Money.Financial.future_value
You're seeing just the function
future_value
, go back to Money.Financial module for more information.
Specs
Calculates the future value for a list of cash flows and an interest rate.
flows
is a list of tuples representing a cash flow. Each flow is represented as a tuple of the form{period, %Money{}}
interest_rate
is a float representation of an interest rate. For example, 12% would be represented as0.12
Example
iex> Money.Financial.future_value([{4, Money.new(:USD, 10000)}, {5, Money.new(:USD, 10000)}, {6, Money.new(:USD, 10000)}], 0.13)
#Money<:USD, 34068.99999999999999999999999>
iex> Money.Financial.future_value [{0, Money.new(:USD, 5000)},{1, Money.new(:USD, 2000)}], 0.12
#Money<:USD, 7600.000000000000000000000000>
Specs
Calculates the future value for a present value, an interest rate and a number of periods.
present_value
is a %Money{} representation of the present valueinterest_rate
is a float representation of an interest rate. For example, 12% would be represented as0.12
periods
in an integer number of periods
Examples
iex> Money.Financial.future_value Money.new(:USD, 10000), 0.08, 1
#Money<:USD, 10800.00>
iex> Money.Financial.future_value Money.new(:USD, 10000), 0.04, 2
#Money<:USD, 10816.0000>
iex> Money.Financial.future_value Money.new(:USD, 10000), 0.02, 4
#Money<:USD, 10824.32160000>