Next / Previous / Contents / TCC Help System / NM Tech homepage

6.2. MixedUnits.mixToSingle(): Convert mixed units to a single value

For a MixedUnits instance M, this method takes a sequence of values representing mixed units, and converts them to a single value in the largest unit.

M.mixToSingle ( valueList )

Here's an example. In the degrees-minutes-seconds system, these statements will convert 38° 52′ 30.7″ to decimal degrees.

>>> dmsSystem = MixedUnits ( (60, 60) )
>>> degrees = dmsSystem.mixToSingle ( (38, 52, 30.7) )
>>> print degrees
38.875194

If the valueList is shorter than the maximum for the system, units are assumed to be from the large end of the system. For example, in the degrees-minutes-seconds system, the value (19, 17.3) is assumed to be 19° 17.3′.