amortization_schedule_calculator v0.0.1 AmortizationScheduleCalculator.CompositeInterest
This protocol defines the functions used to calculate composite interest.
Link to this section Summary
Functions
Calculates the effective interest rate for the entire period given the number of months and the monthly interest rate
Calculates the monthly payment given the amount, interest rate and term in months
Link to this section Functions
Link to this function
effective_interest_rate(term_in_months, monthly_interest_rate)
effective_interest_rate( AmortizationScheduleCalculator.term_in_months(), AmortizationScheduleCalculator.monthly_interest_rate() ) :: AmortizationScheduleCalculator.effective_interest_rate()
Calculates the effective interest rate for the entire period given the number of months and the monthly interest rate.
Examples
iex> CompositeInterest.effective_interest_rate(360, Decimal.new(0.005))
#Decimal<6.022575212263216184054046820>
Link to this function
get_monthly_payment(loan_amount_or_mortage_amount, monthly_interest_rate, term_in_months)
Calculates the monthly payment given the amount, interest rate and term in months.
Examples
iex> CompositeInterest.get_monthly_payment(Money.new(:usd, 100000), Decimal.new(0.005), 360)
#Money<:USD, 599.55>