Skip to content

units

Helper functions for formating and rendering units.

udef_to_string

udef_to_string(udef, model=None, format='latex')

Render formatted string for units.

Format can be either 'str' or 'latex'

Units have the general format (multiplier * 10^scale *ukind)^exponent (m * 10^s *k)^e

Returns None if udef is None or no units in UnitDefinition.

:param udef: unit definition which is to be converted to string