System.Int16.ToString Method

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

Syntax

public string ToString (IFormatProvider provider)

Parameters

provider
An IFormatProvider that supplies culture-specific formatting information.

Returns

The string representation of the value of this instance as specified by provider.

Remarks

The short.ToString(IFormatProvider) method formats an short value in the default ("G", or general) format by using the System.Globalization.NumberFormatInfo object of a specified culture. If you want to specify a different format or the current culture, use the other overloads of the short.ToString(string) method, as follows:

Default ("G") format

Default (current) culture

short.ToString

A specific format

Default (current) culture

short.ToString(string)

A specific format

A specific culture

short.ToString(string, IFormatProvider)

The .NET Framework provides extensive formatting support, which is described in greater detail in the following formatting topics:

The provider parameter is an IFormatProvider implementation whose IFormatProvider.GetFormat(Type) method returns a System.Globalization.NumberFormatInfo object. Typically, provider is a System.Globalization.NumberFormatInfo object or a System.Globalization.CultureInfo object. The System.Globalization.NumberFormatInfo object provides culture-specific information about the format of the string returned by this method. If provider is null, this instance is formatted with the System.Globalization.NumberFormatInfo object for the current culture.

Requirements

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