M

UnitFormatUtils.TryParse

Description:
Parses a formatted string into a number with units if possible.
public static bool TryParse(
	Units units,
	ForgeTypeId specTypeId,
	string stringToParse,
	out double value,
	out string message
)
  • units
    The units formatting settings, typically obtained from Document.GetUnits().
  • specTypeId
    Identifier of the target spec for the value.
  • String
    stringToParse
    The string to parse.
  • Double%
    value
    The parsed value. Ignore this value if the function returns false.
  • String%
    message
    A localized message that, if the parsing fails, explains the reason for failure.
Return Value Boolean True if the string can be parsed, false otherwise.