Flexmonster Software License Agreement (“Agreement”) has been significantly revised and is effective as of September 30, 2024.
The following modifications were made:
The modified version of Flexmonster Software License Agreement is available here.
Downloading, installing, and/or continuing to use Flexmonster Software after September 30, 2024, constitutes Licensee’s acceptance of the terms and conditions of the modified version of Flexmonster Software License Agreement. If Licensee does not agree to any of these terms and conditions, they must cease using Flexmonster Software and must not download, install, use, access, or continue to access Flexmonster Software. By continuing to use Flexmonster Software or renewing the license under License Model or Maintenance after the effective date of any modifications to Agreement, Licensee accepts and agrees to be bound by the terms and conditions of the modified Agreement.
setFormat(format: FormatObject, measureName: String, aggregation: String)
[starting from version: 1.4]
Sets the default number format or a number format for the specified measure.
Learn more about number formatting.
Use the refresh() API call after setting a format to redraw the component and see changes.
Parameter/Type | Description |
---|---|
format FormatObject | Contains the number format parameters. To override the default number format, set the format.name property to an empty string ( "" ). |
measureName String | optional The measure's unique name. Specify this property to apply a format to a specific measure. Must be used with the aggregation parameter unless the measure is calculated. When overriding the default format, skip the measureName . |
aggregation String | optional The measure’s aggregation. Must be used with the measureName. If the measure is calculated, skip the aggregation . |
1) How to override a default number format at runtime:
let format = {
name: "",
decimalPlaces: 0,
thousandsSeparator: ","
};
pivot.setFormat(format);
pivot.refresh();
Try how the sample works on JSFiddle.
2) How to change a currency symbol for a specific measure:
let format = pivot.getFormat("Price", "sum");
format.name = "PriceFormat";
format.currencySymbol = "$";
//format.currencySymbol = "£" // pound sterling
//format.currencySymbol = "€" // euro
//format.currencySymbol = "¥" // yen
pivot.setFormat(format, "Price", "sum");
pivot.refresh();
Open the example on JSFiddle.