Difference between revisions of "Extensions.Quantities.Quantity"
Jump to navigation
Jump to search
(Created page with "{{DISPLAYTITLE:Data Type '''Quantity'''}}Category:DataTypeCategory:Quantities == Classification == {{ClassificationDataType | Quantity | A numeral value which has a di...") |
|||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:Data Type '''Quantity'''}}[[Category:DataType]][[Category:Quantities]] | {{DISPLAYTITLE:Data Type '''Quantity'''}}[[Category:DataType]][[Category:Quantities]] | ||
== Classification == | == Classification == | ||
− | {{ClassificationDataType | Quantity | A numeral value which has a display unit associated with it. | [[ | + | {{ClassificationDataType | Quantity | A numeral value which has a display unit associated with it. | [[Quantities data type]] | - | - | Literal=Yes }} |
== Description == | == Description == | ||
− | A ''Quantity''' represents anumeral value which has a display unit associated with it. For instance, the value "5" is described more specifically by a '''Quantity''' that also contains information about the unit of the value, e.g. "5 km/h". | + | A '''Quantity''' represents anumeral value which has a display unit associated with it. For instance, the value "5" is described more specifically by a '''Quantity''' that also contains information about the unit of the value, e.g. "5 km/h". |
==Literal== | ==Literal== |
Revision as of 10:27, 7 August 2014
Classification
Name | Quantity |
Short Description | A numeral value which has a display unit associated with it. |
Class | Quantities data type |
Base Data Type | - |
Default Value | Empty |
Provide a Literal | Yes |
SpecifiedBy | ISO 13209-3 |
Standard Compliant | Yes |
Description
A Quantity represents anumeral value which has a display unit associated with it. For instance, the value "5" is described more specifically by a Quantity that also contains information about the unit of the value, e.g. "5 km/h".
Literal
The syntax for Literals for complex data types should be used, a QuantityLiteral is the code representation of a value of type NumericQuantity.
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 | Returns the value of Quantity in integer value, float value should be truncat | Integer val = ToInteger(@Quantity:5.5/"km"); // Returns 5 |
ToFloat | Returns the value of Quantity in float value | Float val = ToFloat(@Quantity:5.5/"km"); // Returns 5.5 |
ToString | Returns the value of Quantity in string value | String s = ToString(@Quantity:5.5/"km"); // Returns "5.5" |
ToByteField | Undefined (should not be used) |
Sample
Quantity MyQuantityVariable = @Quantity:5/"km";