LocalisedAmountParser
is typically used in the XML Renderer Framework, but can be invoked programmatically
as in the following example which evaluates to "4900000"
caplin.element.parser.LocalisedAmountParser.parse("4.9MM", {})
See caplin.element.formatter.AmountFormatter for the complementary formatter.
Attributes | Name and Description |
---|---|
|
caplin.element.parser.LocalisedAmountParser()
|
Attributes | Name and Description |
---|---|
|
String
parse(Variant sValue, Object mAttributes)
Parses an amount containing a thousands, millions or billions token into a number. |
►
caplin.element.parser.LocalisedAmountParser()
►
String
parse(Variant sValue, Object mAttributes)
Parses an amount containing a thousands, millions or billions token into a number. If the amount does not match, then null is returned.
Attribute Options:
Option | Description |
---|---|
thousands | the token representing thousands (defaults to K) | millions | the token representing millions (defaults to M) | billions | the token representing billions (defaults to B) |
Variant | sValue | the amount with tokens |
Object | mAttributes | the map of attributes. |