new module:ct-element /parser /Brackets Parser()
Parses an amount with brackets and converts it to a negative number.
BracketsParser
is typically used in the XML Renderer Framework, but can be invoked programmatically
as in the following example which evaluates to '-123':
BracketsParser.parse('(123)', {})
See @link module:ct-element/formatter/BracketsFormatter} for the complementary formatter.
- Implements:
Methods
parse(vValue) → {String}
Converts amounts with brackets and converts it to a negative number.
Parameters:
Name | Type | Description |
---|---|---|
vValue |
Variant | the amount. |
Returns:
the amount, with any brackets removed and converted to a negative number.
- Type
- String