Kernel 8.0 APIs Banner
Office of Information and Technology (OIT) Banner
[skip navigation]

$$WEIGHT^XLFMSMT(): Convert Weight Measurement

Reference Type: Supported, Category: Measurement Functions, ICR#: 3175 & 10143

Description

The $$WEIGHT^XLFMSMT extrinsic function converts U.S. weights to approximate Metric weights and vice versa. It returns the equivalent value with units.

Format

  $$WEIGHT^XLFMSMT(value,from,to)

Input Parameters

value:

(required) A positive numeric value.

from:

(required) Unit of measure of the value input parameter (see table under the to input parameter).

to:

(required) Unit of measure to which the value input parameter is converted (see table below):

Valid units in either uppercase or lowercase are:

Metric US
t—metric tons tn—tons
kg—kilograms lb—pounds
g—grams oz—ounces
mg—milligram gr—grain

Output

returns:

Returns the weight measurement.

Examples

Example 1

Converting U.S. weight to Metric weight:

>S X=$$WEIGHT^XLFMSMT(12,"LB","G")

>W X
5448 G

Example 2

Converting Metric weight to U.S. weight:

>S X=$$WEIGHT^XLFMSMT(5448,"g","lb")

>W X
12.011 LB