Description | Example | Return message | Group

Units_Convert

Convert a value from one unit to another.

Syntax

Units_Convert <ScenarioPath> {Date | Unit} <Parameters>

Related commands

Description

The Units_Convert command is used to convert a value from one unit to a different unit within a dimension.

The format of the Units_Convert Date is as follows:

Units_Convert <ScenarioPath> Date {FromUnit} {ToUnit} "<InputValue>"

The format of the Units_Convert Unit is as follows:

Units_Convert <ScenarioPath> Unit {DimensionName} {FromUnit} {ToUnit} "<InputValue>"

The following table describes the command parameters.

ParameterDescription
{DimensionName}Enter the dimension of the value being converted. (Not valid for Units_Convert Date command.)
{FromUnit}Enter the unit name or abbreviation of the <InputValue>.
{ToUnit}Enter the unit name or abbreviation that the <InputValue> will be converted to.
<InputValue>The value being converted.

Any {FromUnit}, {ToUnit}, or <InputValue> that contains spaces must be enclosed in double quotes.

Use the Units_Get command to get the available dimensions and current unit settings for those dimensions.

Use the Units_Get command with the UnitNames option to get valid unit names for a specified dimension.

Examples

To convert a gregorian date to YYYY:MM:DD:

Units_Convert * Date GregorianUTC YYYY:MM:DD "1 Jul 2005 12:00:00.000"

Return message

2005:07:01:12:00:00.000

Examples

To convert a distance from meters to kilofeet:

Units_Convert * Unit Distance Meter kilofeet 152.32

Return message

0.499738

Examples

To convert an angle from degrees to arc seconds:

Units_Convert * Unit Angle DEGREE "Arc Seconds" 25.3

Return message

91080.000000

Return message

Group membership

This command belongs to the following group(s):

Scenarios

Version

10.1