DecimalFormatter
is typically used in the XML Renderer Framework, but can be invoked programmatically
as in the following example which evaluates to "3.142":
If you are using this formatter in conjunction with the ThousandsFormatter in a localised application, please
ensure this DecimalFormatter comes before the ThousandsFomatter in the renderer xml, otherwise localised
decimal point characters will stop the DecimalFormatter from recognising the number.
caplin.element.formatter.DecimalFormatter.format(3.14159, {dp:3})
Attributes | Name and Description |
---|---|
|
caplin.element.formatter.DecimalFormatter()
|
Attributes | Name and Description |
---|---|
|
String
format(Variant vValue, Map mAttributes)
Formats the value to the specified number of decimal places. |
►
caplin.element.formatter.DecimalFormatter()
►
String
format(Variant vValue, Map mAttributes)
Formats the value to the specified number of decimal places.
Attribute Options:
Option | Description |
---|---|
dp | the number of decimal places to apply. |
Variant | vValue | the number (String or Number type). |
Map | mAttributes | the map of attributes. |