How to set number format


#1

My source code as below:

var pivot = new dhx.Pivot(“cont”, {
fields: {
rows: [‘category_name’],
columns: [{ id: “billing_date”, group: “dateByMonth” }],
values: [{ id: “total_net_price”, method: “sum” }],
},
fieldList: [
{ id: “category_name”, label: “<?php echo $this->lang->line('field_1_category_name') ?>” },
{ id: “billing_date”, label: “<?php echo $this->lang->line('field_1_billing_date') ?>”, type: “date”, format: “%d/%m/%Y”
, template: function (text, obj) {
return ‘’ + text + ‘
}
},
{ id: “total_net_price”, label: “<?php echo $this->lang->line('field_1_total_net_price') ?>”, numberFormat: “0,000.00” },
],
layout: {
rowsHeadersWidth: “auto”,
rowsWidth: 150,
gridOnly: true
}
});

I would like to set Number format by using numberFormat: “0,000.00”
But not work, please let me know how to fix it.


#2

There is no numberFormnat property.
You may use the addMathMethod function to change the format of your data.
Here you can find a working example:
docs.dhtmlx.com/pivot/samples/0 … thods.html