AmountParser
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.AmountParser.parse("4.9MM", {})
See caplin.element.formatter.AmountFormatter for the complementary formatter.
Attributes | Name and Description |
---|---|
|
caplin.element.parser.AmountParser()
|
Attributes | Name and Description |
---|---|
|
String
parse(Variant vValue, Map mAttributes)
Parses an amount containing a thousands, millions or billions token into a number. |
►
caplin.element.parser.AmountParser()
►
String
parse(Variant vValue, Map 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 | vValue | the amount with tokens |
Map | mAttributes | the map of attributes. |