Calculation of mass percent and parts per million