Mono Class Library: System.Convert Overview | Members

System.Convert.ToSingle Method

Converts a string to a float .

public static float ToSingle (string value)

Parameters

value
The string to be converted. The string is in the System.Globalization.NumberStyles.Float | System.Globalization.NumberStyles.AllowThousands style.

Returns

value as a float.

Exceptions

TypeReason
ArgumentNullExceptionvalue is a null reference.
FormatExceptionvalue cannot be converted to a numeric value.
OverflowExceptionThe numeric value of value is greater than float.MaxValue or less than float.MinValue.

Remarks

This method parses value using the information in a System.Globalization.NumberFormatInfo instance initialized for the current system culture.

Requirements

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