The IFormatProvider interface defines one method called GetFormat( ), which returns an object that controls the formatting of data into a human-readable string. The general form of GetFormat( ) is shown here:
object GetFormat(Type fmt)
Here, fmt specifies the format object to obtain.
The IFormattable interface supports the formatting of human-readable output. IFormattable defines this method:
string ToString(string fmt, IFormatProvider fmtpvdr)
Here, fmt specifies formatting instructions and fmtpvdr specifies the format provider.
Note | Formatting is described in detail in Chapter 21. |