System Namespace
Defines a method that supports custom, user-defined formatting of the value of an object.
When this interface is implemented by a reference or value type, the Format method returns a custom-formatted string representation of an object's value.
Use this interface, and the IFormatProvider interface, to supersede the support supplied in .NET Framework formatting methods that honor an IFormatProvider parameter. For example, use this interface to provide custom formatting of the value of an object by the String.Format or Int32.ToString methods.
Derive a class that implements the IFormatProvider interface and its GetFormat method. Specify that derived class for the IFormatProvider parameter of the method you want to supersede. Your implementation of the GetFormat method should return a format object that implements the ICustomFormatter interface. The .NET Framework method will then use your custom formatting instead of its own.
IFormatProvider