TwigExcelBundle
TwigExcelBundle copied to clipboard
How to change number of decimals
I have a cell with a formula and I would like to display only 2 decimals (if the value is 1.123456, I want to display 1.12).
In phpexcel, the following should work:
$sheet->getStyle('A1')->getNumberFormat()->setFormatCode('#,##0.00');
$sheet->getStyle("A1")->getNumberFormat()->setFormatCode('0.00');
I've tried:
{% xlscell 9 {style: {'numberFormat':{'formatCode':'#,##0.00','code':'#,##0.00'}}} %}
=J2 / 2
{% endxlscell %}
But it does not work..
What is the correct way to achieve this ?
For now I m using the Excel FIXED function but it is not optimal..
Did you solved it? I got the same issue.
Unfortunately no, I'm still using the FIXED function
{% xlscell %}=FIXED({{ variable }},2){% endxlscell %}