System.UInt16.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 object that supplies culture-specific formatting information.

Returns

The string representation of the value of this instance, which consists of a sequence of digits ranging from 0 to 9, without a sign or leading zeros.

Remarks

The ushort.ToString(IFormatProvider) method formats a ushort 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 ushort.ToString(string) method, as follows:

Default ("G") format

Default (current) culture

ushort.ToString

A specific format

Default (current) culture

ushort.ToString(string)

A specific format

A specific culture

ushort.ToString(string, IFormatProvider)

The provider parameter is an IFormatProvider implementation. Its IFormatProvider.GetFormat(Type) method returns a System.Globalization.NumberFormatInfo object that provides culture-specific formatting information. However, none of the properties of the System.Globalization.NumberFormatInfo are used when formatting with the general numeric format specifier ("G").

Requirements

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