getFormat(measureName: String): Format Object
[starting from version: 1.4]
Returns Format Object of a default number format or the number format for the specified measure. The number format can be defined via a report or via the setFormat() API method. Each measure has only one format but a format can be applied to more than one measure.
Parameters
measureName
(optional) – String. The unique name of the measure. If the measure’s unique name is not specified or is not found, the default number format will be returned.Examples
1) How to get a precision:
var format = flexmonster.getFormat(); alert("Precision: " + format.decimalPlaces);
Try on JSFiddle.
2) How to change a currency symbol:
var format = flexmonster.getFormat("Price"); format.currencySymbol = "$"; //format.currencySymbol = "£" // pound sterling //format.currencySymbol = "€" // euro //format.currencySymbol = "¥" // yen flexmonster.setFormat(format, "Price"); flexmonster.refresh();
Open the example on JSFiddle.
See also