BSKConvertUnits

Module: BSKUnitDefinition
BSKI32 BSKConvertUnits( BSKUnitDefinition* list,
                        BSKFLOAT quantity,
                        BSKUI32 from,
                        BSKUI32 to,
                        BSKFLOAT* result );
Inputs: Returns: 0 on success, or UERR_INCOMPATIBLE_UNITS if the units were incompatible.

Description: Converts the given quantity (in 'from' units) to the units given by 'to', and stores the new number in 'result'. If the units 'from' and 'to' are not compatible, returns UERR_INCOMPATIBLE_UNITS. Units are incompatible if, by following the path of 'referenceUnit' from one unit to it's parent, a common unit definition cannot be found for both 'from' and 'to'.

Return to the API
Return to the function listing


Last updated on 9 Feb 2001 by Jamis Buck (minam@rpgplanet.com)