Caplin Trader 5.1.0

Interface: module:ct-element/Formatter

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.

Extends

Methods

format(vValue, mAttributes)

Formats a value according to some provided attributes.

Parameters:
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:
Returns:

the formatted value. May not be null or undefined.