Caplin Trader 4.7.1

Class: module:br/formatting/ThousandsFormatter

module:br/formatting/ThousandsFormatter

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/formatting/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/formatting/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