Fixed ZeroDivisionError for some units

Converting units of length to cm, mm or nm would cause a
ZeroDivisionError due to a mistake which caused Python to calculate the
units as integers instead of floats. This shouldn't happen anymore.