Class UnitFormatter
Defines the string formatting of objects having an implementation of IUnit.
public class UnitFormatter : IFormatProvider, ICustomFormatter
- Inheritance
-
UnitFormatter
- Implements
Methods
Format(string, object, IFormatProvider)
Converts the value of a specified arg to an equivalent string representation using specified format and culture-specific format formatProvider.
public string Format(string format, object arg, IFormatProvider formatProvider)
Parameters
formatstringA format string containing formatting specifications.
argobjectAn object that implements the IUnit interface.
formatProviderIFormatProviderAn object that supplies format information about
arg.
Returns
- string
The string representation of the value of
arg, formatted as specified byformatandformatProvider.
GetFormat(Type)
Returns an object that provides formatting services for the specified type.
public object GetFormat(Type formatType)
Parameters
formatTypeTypeAn object that specifies the type of format object to return.
Returns
- object
An instance of the object specified by
formatType, if the IFormatProvider implementation can supply that type of object; otherwise, null.