new module:ct-element /formatter /Percent Formatter()
Converts the number to a percentage.
PercentFormatter
is typically used in the XML Renderer Framework, but can be invoked programmatically
as in the following example which evaluates to "61.8%":
PercentFormatter.format(0.618, {dp:1})
- Implements:
Methods
format(vValue, mAttributes) → {String}
Converts a decimal number to a percentage.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
vValue |
Variant | the decimal number (String or Number type). |
||||||||||||
mAttributes |
Map |
the map of attributes. Properties
|
- Implements:
Returns:
the number specified as a percentage.
- Type
- String