![]() |
![]() |
What query methods are supported for units of measurement?
You can perform queries involving units of measurement, such as value conversions. Linear-dimension unit objects (such as mm, in, m, cm, and pt) are supported, as are unit objects for angles (such as degrees or radians) and file size (such as KB, MB, or GB).
To provide a constant unit of measurement, you must include it in braces ( {}
) along with the unit value and unit of measurement.
Certain math operations can be performed on units of measurement, as in the following examples:
The following query methods are supported for units of measurement:
How are exponents handled?
In addition to the multiplication and division of units of measurement, exponents are supported in queries. Units of different degrees can be specified by using the following general syntax:
Consider the following examples:
Units of power zero (such as {2 mm^0}
) evaluate to regular numeric values that is, {2 mm^0}
equals to a numeric value of 2.
Powers of 2 and 3 can be specified by using special characters
Multiplying units increases the power of the unit, while dividing them decreases the power:
Comparing units can be done only with units of the same power:
However, different units of the same unit category can be used in expressions:
To eliminate rounding error, comparisons of units of measurement are performed with reduced precision. The default precision level is three decimal places of the largest unit involved in comparison. For precise comparison, the precise-equality operator (
When converting units, the unit power must be considered. To convert values between different units, the
Copyright 2007 Corel Corporation. All rights reserved.?/code> (U+00B2) and
?/code> (U+00B3) after the unit of measurement, as in the following examples:
==
) can be used. Consider the following expressions, given that 1 mm equals 2.83464566929134 pt:
unit.convert
method must be used. Consider the following examples: