lib/exonio/financial.rb in exonio-0.5.0 vs lib/exonio/financial.rb in exonio-0.5.1
- old
+ new
@@ -157,10 +157,10 @@
#
def npv(discount, cashflows)
total = 0
cashflows.each_with_index do |cashflow, index|
- total += cashflow / (1 + discount) ** (index + 1)
+ total += (cashflow.to_f / (1 + discount.to_f) ** (index + 1))
end
total
end