new $k.Measurement(value, unitopt) → {$k.Measurement}
| Name | Type | Attributes | Description | 
|---|---|---|---|
value | number | | The measurement's numeric value in the given unit or a $k.Attribute with base unit.  | |
unit | $k. | <optional> | The value's unit either as $k.Unit object or as unit symbol string. If the first argument is a $k.Attribute, the attribute's value will be converted to this unit. If the first argument is a number or interval, this argument is mandatory.  | 
If the parameter combination is not sufficient to determine value and unit
- Type:
 - $k.
Measurement  
Methods
(static) parse(string, QuantityKindopt, languageopt)
Parses a string consisting of a sequence of values and unit symbols. If the parameter quantityKind is not set, the function tries to guess the quantity kind based on the unit symbols used.
| Name | Type | Attributes | Description | 
|---|---|---|---|
string | string | The string representation of the measurement  | |
QuantityKind | object | <optional> | The optional QuantityKind of the measurement  | 
language | language | <optional> | Language of the string  | 
- Since
 - 5.4.2
 
If the units used in the parsed string cannot be resolved or do not belong to the same quantity kind
baseValue() → {number}
- Since
 - 5.4.2
 
- Deprecated
 - Unit systems don't need a unit with factor 1 anymore and units with factor 1 therefore have no special role.
 
The value in relation to the unit with factor 1.
- Type:
 - number
 
quantityKind() → {$k.QuantityKind}
Returns the quantity kind of the measurement.
- Since
 - 5.4.2
 
- Type:
 - $k.
QuantityKind  
toBaseUnit() → {$k.Measurement}
- Since
 - 5.4.2
 
- Deprecated
 - Unit systems don't need a unit with factor 1 anymore and units with factor 1 therefore have no special role.
 
A measurement of same absolut value in the measurements's base unit or undefined, if the measurement's quantity kind has no unit with factor 1.
- Type:
 - $k.
Measurement  
toUnit(unit, languageopt) → {$k.Measurement}
Returns a measurement of same absolut value in the given unit.
| Name | Type | Attributes | Description | 
|---|---|---|---|
unit | $k. | The target unit either as $k.Unit object or as unit symbol string  | |
language | string | <optional> | Optional language to determine the target unit  | 
- Since
 - 5.4.2
 
If the unit cannot be resolved or does not belong to the same quantity kind
- Type:
 - $k.
Measurement  
unit() → {$k.Unit}
Returns the (base) unit of the measurement.
- Since
 - 5.4.2
 
- Type:
 - $k.
Unit  
value(unitopt) → {number|$k.Interval}
| Name | Type | Attributes | Description | 
|---|---|---|---|
unit | $k. | <optional> | Optional unit in which the measurement value is returned, either as $k.Unit object or as unit symbol string. If not specified, the measurement's unit will be used.  | 
- Since
 - 5.4.0
 
If the unit cannot be resolved or does not belong to the same quantity kind
The numeric value (or interval value) of the measurement
- Type:
 - number |
$k. Interval  
valueOf() → {any}
The returned value is only applicable for comparison between measurements and has no other defined semantics.
- Type:
 - any
 
valueString(unitsopt, languageopt) → {string}
Returns the string representation of the measurement. If the units parameter is not set, the measurement's unit or quantity kind is used.
| Name | Type | Attributes | Description | 
|---|---|---|---|
units | $k. | <optional> | The unit(s) to use. If not specified, the measurement's unit will be used.  | 
language | string | <optional> | The language to use  | 
- Since
 - 5.4.0
 
If the units cannot be resolved or do not belong to the same quantity kind
- Type:
 - string