Singleton
caplin.element.formatter

InvalidPriceFormatter

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 "-":

caplin.element.formatter.InvalidPriceFormatter.format("0", {invalidPrice:"-"})

Constructor Summary

Attributes Name and Description
caplin.element.formatter.InvalidPriceFormatter()

Method Summary

Attributes Name and Description
String format(Variant vValue, Map mAttributes)

Substitutes a token for the value if it is not a valid price (a positive number).

Constructor Detail

caplin.element.formatter.InvalidPriceFormatter()

Method Detail

String format(Variant vValue, Map mAttributes)

Substitutes a token for the value if it is not a valid price (a positive number).

Attribute Options:

Option Description
invalidPricethe replacement text in case of an invalid price (defaults to an empty string).

Parameters
Variant vValue the price (String or Number type).
Map mAttributes the map of attributes.
Returns
the replacement text in case of an invalid price, otherwise the unchanged price.