new module:ct-element /formatter /Bond Notation Formatter()
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+":
BondNotationFormatter.format(99.328, {})
- Implements:
Methods
format(vValue, mAttributes) → {String}
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)
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
vValue |
String | Number | the price. |
|||||||||||||||
mAttributes |
Map |
the map of attributes. Properties
|
- Implements:
Returns:
the price expressed in bond notation.
- Type
- String