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 might 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.
The current instance, if formatType is the same type as the current instance; otherwise, anull
reference.
[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