function that discounts a cashflow