Api - units Module
Index
Variables
Functions
Variables
Private base
Private table
Table of conversions. Lazy load upon first conversion.
Type declaration
-
[unitType: string]: object
-
[unitType: string]: number
-
Functions
Private addBaseConversion
-
Add a conversion of the base unit.
Parameters
-
destUnitType: string
-
value: number
Returns void
-
Private addConversion
-
Add a conversion, and its inversion.
Parameters
-
srcUnitType: string
-
destUnitType: string
-
value: number
Returns void
-
conversionScale
-
Get a conversion ratio between a source unit and a destination unit.
Parameters
-
srcUnitType: string
unitType converting from.
-
destUnitType: string
unitType converting to.
Returns number
Numeric ratio of the conversion.
-
Private init
-
Initialize all known conversions here.
Returns void
Generated using TypeDoc
The base type is arbitrary. Other conversions are then based off of this.