new module:ct-element /formatter /Invalid Price Formatter()
Substitutes a token for the value if it is not a valid price.
InvalidPriceFormatter
is typically used in the XML Renderer Framework, but can be invoked programmatically
as in the following example which evaluates to "-":
InvalidPriceFormatter.format("0", {invalidPrice:"-"})
- Implements:
Methods
format(vValue, mAttributes) → {String}
Substitutes a token for the value if it is not a valid price (a positive number).
Parameters:
Name | Type | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
vValue |
Variant | the price (String or Number type). |
||||||||||
mAttributes |
Map |
the map of attributes. Properties
|
- Implements:
Returns:
the replacement text in case of an invalid price, otherwise the unchanged price.
- Type
- String