EDCS Reference Manual
Functions
EDCS ConvertQuantityValue
extern EDCS_Status_Code
EDCS_ConvertQuantityValue
(
constEDCS_Unit_Code src_unit, (notes)
constEDCS_Scale_Code src_scale, (notes)
EDCS_Long_Float src_quantity, (notes)
constEDCS_Unit_Code dest_unit, (notes)
constEDCS_Scale_Code dest_scale, (notes)
EDCS_Long_Float *dest_quantity_ptr (notes)
);

Definition

Given a numeric quantity (src_quantity) specified with a given unit (src_unit) and scale (src_scale), convert that quantity to a specified unit and scale.


Returns

EDCS_STAT_CODE_SUCCESS and *dest_quantity_ptr is set to the result of the specified conversion, if valid parameters were passed in.
EDCS_STAT_CODE_NULL_REQUIRED_PARAMETER and *dest_quantity_ptr is left unchanged, if dest_quantity_ptr was NULL.
EDCS_STAT_CODE_INVALID_SOURCE_UNIT and *dest_quantity_ptr is set to zero (0), if src_unit is not a valid EU code.
EDCS_STAT_CODE_INVALID_DEST_UNIT and *dest_quantity_ptr is set to zero (0), if dest_unit is not a valid EU code.
EDCS_STAT_CODE_INVALID_SOURCE_SCALE and *dest_quantity_ptr is set to zero (0), if src_scale is not a valid EU code.
EDCS_STAT_CODE_INVALID_DEST_SCALE and *dest_quantity_ptr is set to zero (0), if dest_scale is not a valid EU code.
EDCS_STAT_CODE_UNITS_NOT_EQUIVALENT and *dest_quantity_ptr is set to zero (0), if src_unit and dest_unit do not belong to the same EQ.


Parameters Notes


src_unit

 the unit of measure for src_quantity

src_scale

 the unit scale for src_quantity

src_quantity

 the quantity for which a conversion is requested

dest_unit

 the unit of measure requested for *dest_quantity_ptr

dest_scale

 the unit scale requested for *dest_quantity_ptr

dest_quantity_ptr

 pointer to a variable in the user's memory space where
    the result will be copied


Prev: EDCS_CompareUnitEquivalenceCodes. Next: EDCS_EnumNameToAbstractValueType. Up:Index.

Last updated: October 1, 2002 Copyright © 2002 SEDRIS™