Table of Contents

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
Object
PrefixUnitFormatter
Implements
IFormatProvider
ICustomFormatter

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 String

A format string containing formatting specifications.

arg Object

An object that implements the IPrefixUnit interface.

formatProvider IFormatProvider

An object that supplies format information about arg.

Returns

String

The string representation of the value of arg, formatted as specified by format and formatProvider.

GetFormat(Type)

Returns an object that provides formatting services for the specified type.

public object GetFormat(Type formatType)

Parameters

formatType Type

An 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.

See Also

IFormatProvider
ICustomFormatter
IPrefixUnit