Calculate percentage of a quantity (#805)