System Namespace
Provides a mechanism for retrieving an object to control formatting.
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 methods 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.
ICustomFormatter IFormattable