module Finance::Saving
Overview
Collection of formulas used for a fixed rate saving.
Extended Modules
Defined in:
finance/saving.crInstance Method Summary
-
#savings_for_n_years(amount : Float64, rate : Float64, duration : Int32)
Returns the total savings given a fixed amount of savings per month, a yearly rate and the duration in years.
-
#savings_for_one_year(amount : Float64, rate : Float64)
Returns the total savings of a year given a fixed amount of savings per month and a yearly rate.
-
#yearly_interests(capital : Float64, rate : Float64, monthly_savings = 0.0)
Returns the total interests for a single year given an existing capital, a yearly rate and a fixed amount of savings per month.
Instance Method Detail
def savings_for_n_years(amount : Float64, rate : Float64, duration : Int32)
#
Returns the total savings given a fixed amount of savings per month, a yearly rate and the duration in years.
Finance::Saving.savings_for_n_years(100.0, 0.05, 2) # => 2526.13
def savings_for_one_year(amount : Float64, rate : Float64)
#
Returns the total savings of a year given a fixed amount of savings per month and a yearly rate.
Finance::Saving.savings_for_one_year(100.0, 0.05) # => 1232.26
def yearly_interests(capital : Float64, rate : Float64, monthly_savings = 0.0)
#
Returns the total interests for a single year given an existing capital, a yearly rate and a fixed amount of savings per month.
Finance::Saving.yearly_interests(100.0, 0.05, 100.0) # => 37.26