getConversion Method
Compute the conversion factors from fromUnit to toUnit.
Handles normal units, inverted units, and mixed (inverted ↔ non-inverted) conversions.
getConversion(fromUnit: UnitProps, toUnit: UnitProps): Promise<UnitConversionProps>
@returns A UnitConversionProps with factor, offset, and optionally inversion and error.
| Parameter | Type | Description |
|---|---|---|
| fromUnit | UnitProps | The source unit. |
| toUnit | UnitProps | The target unit. |
Returns - Promise<UnitConversionProps>
A UnitConversionProps with factor, offset, and optionally inversion and error.
Defined in
- quantity/src/BasicUnitsProvider.ts Line 101
Last Updated: 08 July, 2026
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.