Fractional8thsFormatter
is typically used in the XML Renderer Framework, but can be invoked programmatically
as in the following example which evaluates to 1\u215B (one and one eighth, in unicode):
caplin.element.formatter.Fractional8thsFormatter.format(1.126, {})
Attributes | Name and Description |
---|---|
|
caplin.element.formatter.Fractional8thsFormatter()
|
Attributes | Name and Description |
---|---|
|
String
format(Variant vValue, Map mAttributes)
Formats a decimal to a mixed fraction, rounded to the nearest eighth. |
►
caplin.element.formatter.Fractional8thsFormatter()
►
String
format(Variant vValue, Map mAttributes)
Formats a decimal to a mixed fraction, rounded to the nearest eighth.
Attribute Options:
Option | Description |
---|---|
leadingZero | if true, mixed fractions with no integer part are shown with a leading zero (defaults to false). |
1 | the character to use for one eighth (optional, defaults to the unicode character for 1/8). |
2 | the character to use for two eighths (optional, defaults to the unicode character for 1/4). |
3 | the character to use for three eighths (optional, defaults to the unicode character for 3/8). |
4 | the character to use for four eighths (optional, defaults to the unicode character for 1/2). |
5 | the character to use for five eighths (optional, defaults to the unicode character for 5/8). |
6 | the character to use for six eighths (optional, defaults to the unicode character for 3/4). |
7 | the character to use for seven eighths (optional, defaults to the unicode character for 7/8). |
Variant | vValue | the decimal number (String or Number type). |
Map | mAttributes | the map of attributes. |