Single.ToString Method (IFormatProvider)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)


Public Function ToString ( _
    provider As IFormatProvider _
) As String
public string ToString(
    IFormatProvider provider


Return Value

Type: System..::.String
The string representation of the value of this instance as specified by provider.




The return value can be PositiveInfinitySymbol, NegativeInfinitySymbol, NaNSymbol, or a string of the form:


Optional elements are framed in square brackets ([ and ]). Elements containing the term "digits" consist of a series of numeric characters ranging from 0 to 9. The following table lists each element.




A negative sign or positive sign symbol.


A series of digits specifying the integral part of the number. Integral-digits can be absent if there are fractional-digits.


A culture-specific decimal point symbol.


A series of digits specifying the fractional part of the number.


A lowercase character 'e', indicating exponential (scientific) notation.


A series of digits specifying an exponent.

Some examples of the return value are "100", "-123,456,789", "123.45e+6", "500", "3.1416", "600", "-0.123", and "-Infinity".

This instance is formatted with the general numeric format specifier ("G").

The provider parameter is an IFormatProvider implementation whose GetFormat method returns a NumberFormatInfo object. Typically, provider is a CultureInfo object or a NumberFormatInfo object. The provider parameter supplies culture-specific information used in formatting. If provider is nullNothingnullptra null reference (Nothing in Visual Basic), the return value is formatted using the NumberFormatInfo data for the current culture.

To convert a Single value to its string representation using a specified culture and a specific format string, call the Single..::.ToString(String, IFormatProvider) method.


The following example displays the string representation of two Single values using CultureInfo objects that represent several different cultures.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0


Windows Phone

See Also


Single Structure

ToString Overload

System Namespace