new module:ct-element /formatter /Fractional8ths Formatter()
Formats a decimal to a mixed fraction, rounded to the nearest eighth.
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):
Fractional8thsFormatter.format(1.126, {})
- Implements:
Methods
format(vValue, mAttributes) → {String}
Formats a decimal to a mixed fraction, rounded to the nearest eighth.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
vValue |
Variant | the decimal number (String or Number type). |
|||||||||||||||||||||||||||||||||||||||||||||
mAttributes |
Map |
the map of attributes. Properties
|
- Implements:
Returns:
the mixed fraction, in unicode.
- Type
- String