def xnpv(rate)
      cf.inject(0) do |sum, t|
        sum + (xnpv_c rate, t.amount, periods_from_start(t.date))
      end
    end
def xnpv(rate)
      cf.inject(0) do |sum, t|
        sum + (xnpv_c rate, t.amount, periods_from_start(t.date))
      end
    end
Net Present Value function that will be used to reduce the cashflow
 @param rate [BigDecimal]
 @return [BigDecimal]