public interface IFormatProvider
mscorlib
BCL
Implemented by classes that supply objects that provide formatting services.
[Note: When a format specifier includes symbols that vary by culture, such as the currency symbol included by the "C" and "c" formats, a formatting object supplies the actual characters used in a string representation of a numeric value. For example, a formatting object may supply "$" for the currency symbol. The formatting object for system-supplied numeric types is a NumberFormatInfo instance. For DateTime instances, a DateTimeFormatInfo is used.IFormatProvider contains the System.IFormatProvider.GetFormat(System.Type) method. The consumer of an object should call this method to obtain a formatting object.
]
System Namespace
IFormatProvider Methods
object GetFormat(Type formatType);
Returns a Object that provides formatting services.
- formatType
- The Type of the formatting object to be returned.
A formatting object of the specified Type. If no formatting object of the specified type is available, or formatType is a null reference, returns the formatting object for the current culture.
[Behaviors: As described above.]
[Overrides: Implement in classes that provide formatting objects for use in methods that generate or parse string representations of objects, such as
ToString
andParse
.]
System.IFormatProvider Interface, System Namespace