Previous: units_parse, Up: Units [Contents]
get the conversion factor from one unit to another
#include <suplib/units.h> double units_cvt( const UnitsList *list, int from, int to );
const UnitsList *list
the Units list
int from
the unit id of the source unit
int to
the unit id of the destination unit
units_cvt
returns a conversion factor from one unit to
another. Both units must be in the passed UnitConvertList
.
Upon success (i.e., the units are in the UnitConvertList
),
it returns the conversion factor. Upon error, it returns
‘0.0’.
Diab Jerius