calculating the decimal portion of a quantity