Caplin Trader 5.1.0

Interface: module:ct-element/Formatter


A Formatter is used to convert values from one format to another.

Typically, they are used to convert machine-readable data to a human-readable format.

A number of Formatter instances are provided in the ct-element/formatter package, but others may be written that implement this simple interface.

All Formatter implementations are singletons.



format(vValue, mAttributes)

Formats a value according to some provided attributes.

Name Type Description
vValue Variant

the value to format. May be null or undefined.

mAttributes Map

A map of attributes to control the way this formatter works. May not be null or undefined.

Inherited From:

the formatted value. May not be null or undefined.