<cfx_kmConvert> cfx_kmSuite
Programming Reference

cfx_kmConvert contains functions related to unit conversions.

Area
Help
Length
Temperature
Version
Volume
Weight

Example
Appendix C: Numeric Format Strings


F=Area

Description
Convert between various units of area measurement.
Returns
The resulting value in the specified TO unit of area.
Syntax
  <cfx_kmConvert  F=Area  V=variable  SHOW
      VALUE=number
      FROM=unit
      TO=unit
      FORMAT=format >
Attribute   Description         Required?
VALUE  Value to convert.
    Supported units
acre acre cm2 square centimeter   ft2 square foot in2 square inch km2 square kilometer m2 square meter mi2 square mile mm2 square millimeter   yd2 square yard
 YES
FROM  Unit of the supplied input value.  YES
TO  Unit of the desired output value.  YES
FORMAT  Desired output format. (default="%.2f")
For more information, refer to Appendix C: Numeric Format Strings.
 no


Examples

<cfx_kmConvert F=Area VALUE=81 FROM=ft2 TO=yd2>
<cfx_kmConvert F=Area VALUE=81 FROM=ft2 TO=yd2
    FORMAT="%.1f sq. yards">
Result:  9.00
9.0 sq. yards

<cfx_kmConvert F=Area VALUE=100 FROM=m2 TO=ft2>
<cfx_kmConvert F=Area VALUE="1076.39" FROM=ft2 TO=m2>
Result:  1076.39
100.00



F=Length

Convert between various units of length.

Returns
The resulting value in the specified TO unit of length.
Syntax
  <cfx_kmConvert  F=Length  V=variable  SHOW
      VALUE=number
      FROM=unit
      TO=unit
      FORMAT=format >
Attribute   Description         Required?
VALUE  Value to convert.
    Supported units
cm centimeter ft foot in inch km kilometer m meter mic micron mi mile mm millimeter naut nautical mile yd yard
 YES
FROM  Unit of the supplied input value.  YES
TO  Unit of the desired output value.  YES
FORMAT  Desired output format. (default="%.2f")
For more information, refer to Appendix C: Numeric Format Strings.
 no


Examples

<cfx_kmConvert F=Length VALUE=10 FROM=ft TO=in
    FORMAT="%.0f ft">
Result:  120 ft

<cfx_kmConvert F=Length VALUE=100 FROM=ft TO=m
    FORMAT="%.3f meters">
<cfx_kmConvert F=Length VALUE="30.480" FROM=m TO=ft
    FORMAT="%.1f feet">
Result:  30.480 meters
100.0 feet



F=Temperature

Description
Convert between various units of temperature.
Returns
The resulting value in the specified TO unit of temperature.
Syntax
  <cfx_kmConvert  F=Temperature  V=variable  SHOW
      VALUE=number
      FROM=unit
      TO=unit
      FORMAT=format >
Attribute   Description         Required?
VALUE  Value to convert.
    Supported units
ce Celsius fa Fahrenheit
 YES
FROM  Unit of the supplied input value.  YES
TO  Unit of the desired output value.  YES
FORMAT  Desired output format. (default="%.2f")
For more information, refer to Appendix C: Numeric Format Strings.
 no


Examples

<cfx_kmConvert F=Temperature VALUE=32 FROM=fa TO=ce
    FORMAT="%.0f">
<cfx_kmConvert F=Temperature VALUE=212 FROM=fa TO=ce>
Result:  0
100.00

<cfx_kmConvert F=Temperature VALUE=212 FROM=ce TO=fa
    FORMAT="%.1f F">
<cfx_kmConvert F=Temperature VALUE=413.6 FROM=ce TO=fa
    FORMAT="%.1f F">
Result:  413.6 F
212.0 F



F=Volume


Description
Convert between various units of volume.
Returns
The resulting value in the specified TO unit of volume.
Syntax
  <cfx_kmConvert  F=Volume  V=variable  SHOW
      VALUE=number
      FROM=unit
      TO=unit
      FORMAT=format >
Attribute   Description         Required?
VALUE  Value to convert.
    Supported units
bu US bushel cm3 cubic centimeter cup cup ft3 cubic foot gal US liquid gallon gal-dry US dry gallon gal-uk UK gallon in3 cubic inch l liter m3 cubic meter oz US liquid ounce pt US liquid pint pt-dry US dry pint pt-uk UK pint qt US liquid quart qt-dry US dry quart qt-uk UK quart tbsp tablespoon tsp teaspoon yd3 cubic yard
 YES
FROM  Unit of the supplied input value.  YES
TO  Unit of the desired output value.  YES
FORMAT  Desired output format. (default="%.2f")
For more information, refer to Appendix C: Numeric Format Strings.
 no


Examples

<cfx_kmConvert F=Volume VALUE=100 FROM=m3 TO=ft3>
<cfx_kmConvert F=Volume VALUE=3531.47 FROM=ft3 TO=m3>
<cfx_kmConvert F=Volume VALUE=100 FROM=gal TO=qt>
Result:  3531.47
100.00
400.00



F=Weight

Description
Convert between various units of weight.
Returns
The resulting value in the specified TO unit of weight.
Syntax
  <cfx_kmConvert  F=Weight  V=variable  SHOW
      VALUE=number
      FROM=unit
      TO=unit
      FORMAT=format >
Attribute   Description         Required?
VALUE  Value to convert.
    Supported units
g gram lb pound kg kilogram mg milligram oz ounce ton-m metric ton
 YES
FROM  Unit of the supplied input value.  YES
TO  Unit of the desired output value.  YES
FORMAT  Desired output format. (default="%.2f")
For more information, refer to Appendix C: Numeric Format Strings.
 no


Examples

<cfx_kmConvert F=Weight VALUE=100 FROM=kg TO=lb>
<cfx_kmConvert F=Weight VALUE=220.46 FROM=lb TO=kg>
<cfx_kmConvert F=Weight VALUE=100 FROM=lb TO=kg>
Result:  220.46
100.00
45.36