module Finance::Loan

Overview

Collection of formulas used for a fixed rate redeemable loan.

Extended Modules

Defined in:

finance/loan.cr

Instance Method Summary

Instance Method Detail

def borrowing_cap(capacity : Float64, rate : Float64, duration : Int32) #

Returns the borrowing capacity given the monthly payment capacity, the yearly rate and the duration of the loan in month.

Finance::Loan.borrowing_cap(1, 0.12, 12) # => 11.26

[View source]
def loan_schedule(fund : Float64, rate : Float64, duration : Int32, date = Time.now) #

Returns the loan schedule given the fund borrowed, the yearly rate and the duration of the loan in month.

Finance::Loan.loan_schedule(100, 0.12, 12)

[View source]
def monthly_payment(fund : Float64, rate : Float64, duration : Int32) #

Returns the monthly payment due given the fund borrowed, the yearly rate and the duration of the loan in month.

Finance::Loan.monthly_payment(100, 0.12, 12) # => 8.88

[View source]
def total_cost(fund : Float64, rate : Float64, duration : Int32) #

Returns the total cost of the loan, i.e. the sum of all the monthly interests given the fund borrowed, the yearly rate and the duration of the loan in month.

Finance::Loan.total_cost(100, 0.12, 12) # => 6.56

[View source]