Menu
Download Free Trial
Table of contents

getFormat

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 report or via setFormat() API method. Each measure has only one format but a format can be applied to more than one measure.

Parameters

  • measureName (optional) – the unique name of the measure. If measure’s unique name is not specified or it 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

setFormat
Format Object