calculate rate of interest