Extensions.Quantities.Unit

From emotive
Revision as of 10:37, 7 August 2014 by Nb (talk | contribs) (Created page with "{{DISPLAYTITLE:Data Type '''Unit'''}}Category:DataTypeCategory:Quantities == Classification == {{ClassificationDataType | Unit | A physical unit which is defined in a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Classification

Name Unit
Short Description A physical unit which is defined in a UNIT-SPEC.
Class Quantities data type
Base Data Type -
Default Value Empty
Provide a Literal Yes
SpecifiedBy ISO 13209-3
Standard Compliant Yes

Description

A Unit represents a physical unit which is defined in a UNIT-SPEC. A Unit can be associated to a physical value when creating a Quantity, but it can also be used stand-alone, e.g. when comparing the display Unit of a Quantity to another Unit object.

Literal

The syntax for Literals for complex data types should be used, UnitLiteral be used to create a Unit object based on a unit definition contained in UNIT-SPEC document.

Value = Literal

Core Conversion

The following table shows the rules for conversion to another data type:

Conversion Result Sample
ToBoolean Undefined (should not be used)
ToInteger Undefined (should not be used)
ToFloat Undefined (should not be used)
ToString Returns the name of the Unit object String s = ToString(@Unit:"km"); // Returns "km"
ToByteField Undefined (should not be used)

Sample

Unit MyUnitVariable = @Unit:"km";