Money.Financial.payment

You're seeing just the function payment, go back to Money.Financial module for more information.
Link to this function

payment(present_value, interest_rate, periods)

View Source

Specs

payment(Money.t(), float(), number()) :: Money.t()

Calculates the payment for a given loan or annuity given a present value, an interest rate and a number of periods.

  • present_value is a %Money{} representation of the present value

  • interest_rate is a float representation of an interest rate. For example, 12% would be represented as 0.12

  • periods is an integer number of periods

Example

iex> Money.Financial.payment Money.new(:USD, 100), 0.12, 20
#Money<:USD, 13.38787800396606622792492299>