Converting Measurement Units
Use
Function Group SCV0
This function group contains the following function modules:
-
CONVERSION_FACTOR_GET
This function module gets the conversion factors between one measurement unit and another, from the measurement unit table. This only applies for measurement units within a dimension.
It also returns the number of decimal places to which the values in the unit UNIT_OUT are to be rounded. This also applies to dimension-less units.
The conversion formular is:
-
UNIT_OUT = UNIT_IN * numerator/denominator + constant.
-
-
ROUND
This function module rounds a value to the specified number of decimal places. You can choose from the following ways of rounding:
-
Round up
-
Round down
-
Commercial rounding
The rounding is performed internally with the same field type as the field passed.
So rounding a FLOAT value can cause rounding errors. For high calculation accuracy, the transfer field should have the type.
-
-
SI_UNIT_GET
You pass either a unit or a dimension to this function module, to get the SI unit. If you pass a unit and a dimension, the SI unit for the dimension is determined.
-
UNIT_CONVERSION_WITH_FACTOR
This function module converts a value according to the factors passed.
-
UNIT_CORRESPONDENCE_CHECK
This function modules checks whether two units passed have the same dimension.
-
UNIT_GET
This function module gets the measurement unit for a dimension and conversion factors.
-
UNIT_CONVERSION_SIMPLE
This function module converts a value according to the measuremt units table, and may round it.
You can also round without a calculation.
To be able to convert with this function module, the measurement unit table must be maintained for both units, and both units must have the same dimension, and have a dimension.
Units without dimensions can be rounded.