Module: CashFlowAnalysis::Calculator::Cagr
- Defined in:
- lib/cash_flow_analysis/calculator/cagr.rb
Class Method Summary collapse
-
.calculate(start_value, end_value, years) ⇒ Numeric
Calculates the CAGR based on a start value, end value, and a term.
Class Method Details
.calculate(start_value, end_value, years) ⇒ Numeric
Calculates the CAGR based on a start value, end value, and a term.
10 11 12 |
# File 'lib/cash_flow_analysis/calculator/cagr.rb', line 10 def self.calculate(start_value, end_value, years) ((end_value.to_f / start_value) ** (1.0 / (years))) - 1 end |