Singleton
caplin.element.formatter

PercentFormatter

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%":

caplin.element.formatter.PercentFormatter.format(0.618, {dp:1})

Constructor Summary

Attributes Name and Description
caplin.element.formatter.PercentFormatter()

Method Summary

Attributes Name and Description
String format(Variant vValue, Map mAttributes)

Converts a decimal number to a percentage.

Constructor Detail

caplin.element.formatter.PercentFormatter()

Method Detail

String format(Variant vValue, Map mAttributes)

Converts a decimal number to a percentage.

Parameters
Variant vValue the decimal number (String or Number type).
Map mAttributes a list of attributes, as specified in caplin.element.formatter.RoundingFormatter.
Returns
the number specified as a percentage.