Caplin Trader 4.0.3

Class: module:br/presenter/formatter/ThousandsFormatter

module:br/presenter/formatter/ThousandsFormatter

Summary

Adds a separator character for each 'thousand' position (e.g. 1,000,000).

ThousandsFormatter is typically used with Presenter, but can be invoked programmatically too. This formatter must be run after the module:br/presenter/formatter/DecimalFormatter, otherwise different locale formats for decimal places may confuse the DecimalFormatter.

The following attributes are required:

  • separator - the character to use as a thousands separator

Constructor

new module:br/presenter/formatter/ThousandsFormatter()

Implements:

Methods

format(sValue, mAttributes)

Adds a separator character for each 'thousand' position in a number. eg 1000000 becomes 1,000,000
Parameters:
Name Type Description
sValue String The field value
mAttributes Map The formatter attributes
Implements:
Returns:
The formatted value

toString()

Returns a human-readable string representation of the object, which is useful for debugging.
Implements:
Returns:
The string representation