Class UnitPrefixFormatter
- Namespace
- Cuemon
- Assembly
- Cuemon.Core.dll
Defines the string formatting of objects having an implementation of either IPrefixUnit or IUnit. Implements the System.IFormatProvider Implements the System.ICustomFormatter
public class UnitPrefixFormatter : IFormatProvider, ICustomFormatter
- Inheritance
-
ObjectUnitPrefixFormatter
- 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 either interface IPrefixUnit, IUnit or both.
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.