Money.Financial.interest_rate
You're seeing just the function
interest_rate
, go back to Money.Financial module for more information.
Specs
Calculates the effective interest rate for a given present value, a future value and a number of periods.
present_value
is a %Money{} representation of the present valuefuture_value
is a %Money{} representation of the future valueperiods
is an integer number of a period
Examples
iex> Money.Financial.interest_rate Money.new(:USD, 10000), Money.new(:USD, 10816), 2
#Decimal<0.04>
iex> Money.Financial.interest_rate Money.new(:USD, 10000), Money.new(:USD, "10824.3216"), 4
#Decimal<0.02>