M

UnitUtils.Convert

Description:
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
)
  • Double
    value
    The value to convert.
  • currentUnitTypeId
    Identifier of the current unit.
  • desiredUnitTypeId
    Identifier 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.