Singleton
caplin.element.formatter

BondNotationFormatter

Formats a bond price into one of two standard market convention notations.

BondNotationFormatter is typically used in the XML Renderer Framework, but can be invoked programmatically as in the following example, which evaluates to "99-10+":

caplin.element.formatter.BondNotationFormatter.format(99.328, {})

Constructor Summary

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

Method Summary

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

Formats a bond price into one of two standard market convention notations.

Constructor Detail

caplin.element.formatter.BondNotationFormatter()

Method Detail

String format(Variant vValue, Map mAttributes)

Formats a bond price into one of two standard market convention notations.

Two market conventions are supported, which both express the fractional part of the price as a whole number of 32nds, followed by a remainder which is expressed in as a number of eighths in two different ways:

Fractions notation expresses the remainder as a unicode fraction, but using + to represent a half (e.g. 102-05+)
Decimal notation expresses the remainder as number of eighths, from 00 to 07 (e.g. 102-05 04)

Attribute Options:

Option Description
fractionsif true, then fractions notation will be used (defaults to false).
roundingrounding method for least significant 8th: "up", "down" (optional, defaults to nearest 8th).

Parameters
Variant vValue the price (String or Number type).
Map mAttributes the map of attributes.
Returns
the price expressed in bond notation.