Click or drag to resize

CurrentTryParse(String, NumberStyles, IFormatProvider, Current) Method

Converts the string representation of a number in a specified style and culture-specific format to its Current equivalent. A return value indicates whether the conversion succeeded or failed.

Namespace: GSF.Units
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax
public static bool TryParse(
	string s,
	NumberStyles style,
	IFormatProvider provider,
	out Current result
)
View Source

Parameters

s  String
A string containing a number to convert.
style  NumberStyles
A bitwise combination of System.Globalization.NumberStyles values that indicates the permitted format of s.
provider  IFormatProvider
A IFormatProvider object that supplies culture-specific formatting information about s.
result  Current
When this method returns, contains the Current value equivalent to the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null, is not in a format compliant with style, or represents a number less than MinValue or greater than MaxValue. This parameter is passed uninitialized.

Return Value

Boolean
true if s was converted successfully; otherwise, false.
Exceptions
ExceptionCondition
ArgumentException style is not a System.Globalization.NumberStyles value. -or- style is not a combination of System.Globalization.NumberStyles.AllowHexSpecifier and System.Globalization.NumberStyles.HexNumber values.
See Also