Provides a mechanism for retrieving an object to control formatting.
For a list of all members of this type, see IFormatProvider Members.
[Visual Basic] Public Interface IFormatProvider [C#] public interface IFormatProvider [C++] public __gc __interface IFormatProvider [JScript] public interface IFormatProvider
| Class | Description |
|---|---|
| CultureInfo | Represents information about a specific culture including the names of the culture, the writing system, and the calendar used, as well as access to culture-specific objects that provide information for common operations, such as formatting dates and sorting strings. |
| DateTimeFormatInfo | Defines how DateTime values are formatted and displayed, depending on the culture. |
| NumberFormatInfo | Defines how numeric values are formatted and displayed, depending on the culture. |
Some methods in the common language runtime convert a value to or from a string representation and take a string parameter that contains one or more characters, called format specifiers, which indicate how the value is to be converted. If the meaning of the format specifier varies by culture, a formatting object supplies the actual characters used in the string representation.
A class or value type implements the GetFormat method of this interface to obtain an object that provides format information or processing for the implementing type.
For example, IFormatProvider is implemented by NumberFormatInfo and DateTimeFormatInfo. NumberFormatInfo provides culture-specific information used to format numbers in the base data types, and DateTimeFormatInfo provides culture-specific information used to format date and time values.
Namespace: System
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework - Windows CE .NET
Assembly: Mscorlib (in Mscorlib.dll)
IFormatProvider Members | System Namespace | ICustomFormatter | IFormattable