Calculating percentages from a given quantity