UnitFormatUtils.TryParse
Description:
Parses a formatted string into a number with units if possible.
Parses a formatted string into a number with units if possible.
Overloads (4):
TryParse(Units,ForgeTypeId,String,Double,String)
public static bool TryParse(
Units units,
ForgeTypeId specTypeId,
string stringToParse,
out double value,
out string message
)
-
unitsThe units formatting settings, typically obtained from Document.GetUnits().
-
specTypeIdIdentifier of the target spec for the value.
-
StringstringToParseThe string to parse.
-
Double%valueThe parsed value. Ignore this value if the function returns false.
-
String%messageA localized message that, if the parsing fails, explains the reason for failure.
-
specTypeId is not a measurable spec identifier. See UnitUtils.IsMeasurableSpec(ForgeTypeId).
-
A non-optional argument was null