Unit (FPScript)

21.09.2021

Returns the unit of a data set as a quantity with the value 1.

Syntax

Unit(DataSet)

 

The syntax of the Unit function consists of the following parts:

Part

Description

DataSet

The data set whose unit is to be determined.

All data structures are allowed. All data types are permitted.

Remarks

As the result the function returns a scalar value of data type 64-bit floating point.

The unit is returned as a 64-bit floating point value of 1 with a unit. For aggregate data structures, only the Y component is considered.

Available in

FlexPro Basic, Professional, Developer Suite

Examples

Unit(5.6 V)

Results in 1 V.

Unit({56 mV, 7.8 V})

Results in 1 mV.

AdjustUnit(Frequency, 1. / Unit(Time))

The 'Frequency' unit is transformed to the reciprocal value of the 'Time' unit.

See Also

AdjustUnit Function

UnitSymbol Function

SIUnits Function

UnitType Function

Unit Manager

Quantities in FPScript

Share article or send as email:

You might be interested in these articles