Click or drag to resize

HalfTypeTryParse Method (String, NumberStyles, IFormatProvider, HalfType)

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

Namespace:  NeoAxis
Assembly:  NeoAxis.Core (in NeoAxis.Core.dll) Version: 2024.1.1.0 (2024.1.1.0)
Syntax
C#
public static bool TryParse(
	string value,
	NumberStyles style,
	IFormatProvider provider,
	out HalfType result
)

Parameters

value
Type: SystemString
The string representation of the number to convert.
style
Type: System.GlobalizationNumberStyles
A bitwise combination of System.Globalization.NumberStyles values that indicates the permitted format of value. A typical value to specify is System.Globalization.NumberStyles.Number.
provider
Type: SystemIFormatProvider
An System.IFormatProvider object that supplies culture-specific parsing information about value.
result
Type: NeoAxisHalfType
When this method returns, contains the System.Half number that is equivalent to the numeric value contained in value, if the conversion succeeded, or is 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 System.Half.MinValue or greater than System.Half.MaxValue. This parameter is passed uninitialized.

Return Value

Type: Boolean
true if s was converted successfully; otherwise, false.
Exceptions
ExceptionCondition
ArgumentException style is not a System.Globalization.NumberStyles value. -or- style is the System.Globalization.NumberStyles.AllowHexSpecifier value.
See Also