asp.net.ph

IFormattable.ToString Method ( String, IFormatProvider )

System Namespace   IFormattable Interface


Formats the value of the current instance using the specified format.

[ VB ]
Function ToString ( _
   ByVal format As String, _
   ByVal formatProvider As IFormatProvider _
) As String

[ C# ]
string ToString (
   string format,
   IFormatProvider formatProvider
);

[ C++ ]
String* ToString (
   String* format,
   IFormatProvider* formatProvider
);

[ JScript ]
function ToString (
   format : String,
   formatProvider : IFormatProvider
) : String;

Parameters

format
The String specifying the format to use.

-or-

A null reference ( Nothing in Visual Basic ) to use the default format defined for the type of the IFormattable implementation.

formatProvider
The IFormatProvider to use to format the value.

-or-

A null reference ( Nothing in Visual Basic ) to obtain the numeric format information from the current locale setting of the operating system.

Return Value

A String containing the value of the current instance in the specified format.

Remarks

NumberFormatInfo, DateTimeFormatInfo and CultureInfo implement the IFormatProvider interface.

NumberFormatInfo supplies numeric formatting information, such as the characters to use for decimal and thousand separators and the spelling and placement of currency symbols in monetary values.

DateTimeFormatInfo supplies date- and time-related formatting information, such as the position of the month, the day and the year in a date pattern.

CultureInfo contains the default formatting information in a specific culture, including the numeric format information and date- and time-related formatting information.

See Also

IFormattable Members   String   IFormatProvider   CultureInfo   DateTimeFormatInfo   NumberFormatInfo Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph