System.IFormatProvider Interface

public interface IFormatProvider

Assembly

mscorlib

Library

BCL

Summary

Implemented by classes that supply objects that provide formatting services.

Description

[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.

]

See Also

System Namespace

Members

IFormatProvider Methods

IFormatProvider.GetFormat Method


IFormatProvider.GetFormat Method

object GetFormat(Type formatType);

Summary

Returns a Object that provides formatting services.

Parameters

formatType
The Type of the formatting object to be returned.

Return Value

The current instance, if formatType is the same type as the current instance; otherwise, a null reference.

Description

[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 and Parse .]

See Also

System.IFormatProvider Interface, System Namespace