Methods
(static) convertUnitValue(options) → {ConvertUnitValueResult}
Formats a value according to the passed options
Parameters:
Name |
Type |
Description |
options |
ConvertUnitValueOptions
|
The options |
- Source:
Returns:
-
Type
-
ConvertUnitValueResult
Type Definitions
ConvertUnitValueOptions
Type:
Properties:
Name |
Type |
Description |
value |
number
|
The value that should be formatted |
units |
Array.<Unit>
|
The units that should be considered by this function |
- Source:
ConvertUnitValueResult
Type:
Properties:
Name |
Type |
Description |
value |
number
|
The original value |
convertedValue |
number
|
The converted value |
unit |
Unit
|
The unit to which the value was converted to |
- Source:
Unit
Type:
Properties:
Name |
Type |
Attributes |
Default |
Description |
factor |
number
|
<optional>
|
1
|
The factor used to convert a number |
abbreviation |
string
|
|
|
The abbreviation used for this unit |
limit |
number
|
<optional>
|
factor
|
The limit at which it shall be converted to this unit |
fallback |
boolean
|
<optional>
|
false
|
If true, this unit will be used as a fallback |
- Source: