Calculating the percentage of a quantity