Mono Class Library: System.Xml.XmlConvert Overview | Members

System.Xml.XmlConvert.ToSingle Method

Converts a string to a float equivalent. [Edit]

public static float ToSingle (string s)

Parameters

s
The string to convert. [Edit]

Returns

The float equivalent of s. [Edit]

Exceptions

TypeReason
ArgumentNullExceptions is a null reference. [Edit]
FormatExceptions is not in the correct format. [Edit]
OverflowExceptions represents a number less than float.MinValue or greater than float.MaxValue. [Edit]

Remarks

If s is "-INF", this method returns float.NegativeInfinity.

If s is "INF", this method returns float.PositiveInfinity.

Otherwise, this method calls float.Parse(string)(s, System.Globalization.NumberStyles.AllowLeadingSign|System.Globalization.NumberStyles.AllowDecimalPoint|System.Globalization.NumberStyles.AllowExponent|System.Globalization.NumberStyles.AllowLeadingWhite|System.Globalization.NumberStyles.AllowTrailingWhite, System.Globalization.NumberFormatInfo.InvariantInfo).

[Edit]

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0