Int16::ToString Method (IFormatProvider)
Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.
Assembly: mscorlib (in mscorlib.dll)
Return ValueType: System::String
The string representation of the value of this instance as specified by provider.
The return value is formatted with the general numeric format specifier ("G").
The .NET Framework provides extensive formatting support, which is described in greater detail in the following formatting topics:
For more information about formatting, see Formatting Types.
The provider parameter is an IFormatProvider implementation whose IFormatProvider::GetFormat method returns a NumberFormatInfo object. Typically, provider is a NumberFormatInfo object or a CultureInfo object. The NumberFormatInfo object provides culture-specific information about the format of the string returned by this method. If provider is nullptr, this instance is formatted with the NumberFormatInfo object for the current culture.
The following example iterates an array of Int16 values and displays each of them to the console by calling the method with different format providers. Because of the simple formatting defined by the default "G" format specifier, the formatted strings produced for each Int16 value are identical regardless of the value of the provider parameter.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.