Singleton
caplin.element.formatter

LocalisedAmountFormatter

Formats a number into a localised string representation.

LocalisedAmountFormatter Formats a number to a configuarble number of decimal placess according to current locale of browser. It automatically detects the current locale of the the browser and uses that to format numbers. For example
1234567.89 = 1,234,567.89 in english locale
1234567.89 = 1.234.567,89 in french locale
It is typically used in the XML Renderer Framework, but can be invoked programmatically:

caplin.element.formatter.LocalisedAmountFormatter.format(1234567890, {}) caplin.element.formatter.LocalisedAmountFormatter.format(1234567890, {dp: 4})

Constructor Summary

Attributes Name and Description
caplin.element.formatter.LocalisedAmountFormatter()

Method Summary

Attributes Name and Description
String format(Variant vValue, Map mAttributes)

Formats a number into an localised string representation.

Constructor Detail

caplin.element.formatter.LocalisedAmountFormatter()

Method Detail

String format(Variant vValue, Map mAttributes)

Formats a number into an localised string representation.

Parameters
Variant vValue the numeric amount (Number type). if a string is passed it is returned unchanged.
Map mAttributes a list of attributes, as specified here and in. dp: number of decinal places to be displayed. Rounding occurs according to standard javascript behaviour.
Returns
the tokenized amount.