Calculates mol mass after compound is input