Skip to content
This repository was archived by the owner on May 19, 2024. It is now read-only.
This repository was archived by the owner on May 19, 2024. It is now read-only.

How to change number of decimals #33

@thmsbernard

Description

@thmsbernard

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..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions