Class PrefixUnitFormatter
- Namespace
- Codebelt.Unitify
- Assembly
- Codebelt.Unitify.dll
Defines the string formatting of objects having an implementation of IPrefixUnit.
public class PrefixUnitFormatter : IFormatProvider, ICustomFormatter
- Inheritance
-
ObjectPrefixUnitFormatter
- Implements
-
IFormatProviderICustomFormatter
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
format
StringA format string containing formatting specifications.
arg
ObjectAn object that implements the IPrefixUnit interface.
formatProvider
IFormatProviderAn object that supplies format information about
arg
.
Returns
- String
The string representation of the value of
arg
, formatted as specified byformat
andformatProvider
.
GetFormat(Type)
Returns an object that provides formatting services for the specified type.
public object GetFormat(Type formatType)
Parameters
formatType
TypeAn object that specifies the type of format object to return.
Returns
- Object
An instance of the object specified by
formatType
, if the System.IFormatProvider implementation can supply that type of object; otherwise, null.