new module:ct-element /formatter /Rounding Formatter()
Formats the value to the specified rounding.
RoundingFormatter
is typically used in the XML Renderer Framework, but can be invoked programmatically
as in the following example which evaluates to '3.142':
RoundingFormatter.format(3.14159, {dp:3})
- Implements:
Methods
format(vValue, mAttributes) → {String}
Formats the number to the specified precision.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
vValue |
Variant | the number. |
||||||||||||
mAttributes |
Map |
the map of attributes. Properties
|
- Implements:
Returns:
the number, formatted to the specified precision.
- Type
- String