UnitUtils.Convert
Description:
Converts a value from one unit to another, such as square feet to square meters.
Converts a value from one unit to another, such as square feet to square meters.
public static double Convert(
double value,
ForgeTypeId currentUnitTypeId,
ForgeTypeId desiredUnitTypeId
)
-
DoublevalueThe value to convert.
-
currentUnitTypeIdIdentifier of the current unit.
-
desiredUnitTypeIdIdentifier of the desired unit.
Return Value
Double
The converted value.
-
The given value for value is not finite -or- currentUnitTypeId is not a unit identifier. See UnitUtils.IsUnit(ForgeTypeId) and UnitUtils.GetUnitTypeId(DisplayUnitType). -or- desiredUnitTypeId is not a unit identifier. See UnitUtils.IsUnit(ForgeTypeId) and UnitUtils.GetUnitTypeId(DisplayUnitType).
-
A non-optional argument was null
-
currentUnitTypeId and desiredUnitTypeId have different dimensions.