AmountFormatter
is typically used in the XML Renderer Framework, but can be invoked programmatically
as in the following example which evaluates to "1.23456789B" and "1.230B" respectively:
caplin.element.formatter.AmountFormatter.format(1234567890, {})
caplin.element.formatter.AmountFormatter.format(1234567890, {dp: 4})
Attributes | Name and Description |
---|---|
|
caplin.element.formatter.AmountFormatter()
|
Attributes | Name and Description |
---|---|
|
String
format(Variant vValue, Map mAttributes)
Formats a number into an amount with a thousands, millions or billions token. |
►
caplin.element.formatter.AmountFormatter()
►
String
format(Variant vValue, Map mAttributes)
Formats a number into an amount with a thousands, millions or billions token.
Attribute Options:
Option | Description |
---|---|
thousands | token representing thousands (defaults to K). |
millions | token representing millions (defaults to M). |
billions | token representing billions (defaults to B). |
Variant | vValue | the numeric amount (String or Number type). |
Map | mAttributes | a list of attributes, as specified here and in caplin.element.formatter.RoundingFormatter. |