Have tried multiple formats to remove .0 decimal in column cant see to remove.
Below is formatting
const format = {
name: 'removeDecimal',
decimalPlaces: 0,
};
this.citationPivot.flexmonster.setFormat(format);
Hello,
Thank you for contacting us.
Kindly note that if you want to set the default format for all the fields, the name
property of the format
object should be set to ""
:
const format = {
name: "",
decimalPlaces: 0,
}
Also, you should use the refresh() API call after setting a format to see changes. Please check the following example for reference: https://jsfiddle.net/flexmonster/Lft15349/.
Please let us know if it works for you. Looking forward to hearing from you.
Kind regards,
Nadia
1. your fiddle example is also broken on Export to Excel. it has .0 decimal.
Please let me know how to fix as soon as you can.
My code with refresh
exportExcel(whichTab) {
let currentTitleExcel =
'<center><h1>' + this.customLabel + '</h1></center>';
const format = {
name: '',
decimalPlaces: 0,
};
switch (whichTab) {
case 'TAB1':
{
this.testPivot.flexmonster.setFormat(format);
this.testPivot.flexmonster.refresh();
this.testPivot.flexmonster.exportTo('excel', {
header: testTitleExcel.toString(),
});
}
break;
case 'TAB2':
{
this.test2Pivot.flexmonster.setFormat(format);
this.test2Pivot.flexmonster.refresh();
this.test2Pivot.flexmonster.exportTo('excel', {
header: currentTitleExcel.toString(),
});
}
break;
default:
{
//do nothing
}
break;
}
}