Caplin Trader 4.8.0

Class: module:br/formatting/NullValueFormatter

module:br/formatting/NullValueFormatter

Substitutes text when the value is null, undefined, or the empty string.

NullValueFormatter is typically used with Presenter, but can be invoked programmatically as in the following example which evaluates to "N/A":

br.formatting.NullValueFormatter.format("", {nullValue:"N/A"})

Constructor

new module:br/formatting/NullValueFormatter()

Implements:

Methods

format(vValue, mAttributes)

Substitutes replacement text when the string is void (null, undefined, or the empty string).

Attribute Options:

Option Description
nullValue the replacement text to substitute in case of a null string (defaults to an empty string)
Parameters:
Name Type Description
vValue Variant the string.
mAttributes Map the map of attributes.
Implements:
Returns:
the replacement string in the case of a void, otherwise the unchanged string.