Phpspreadsheet: Currency Brazilian Format

Created on 9 Jan 2018  路  2Comments  路  Source: PHPOffice/PhpSpreadsheet

This is:

- [x] a bug report

What is the expected behavior?

Format values with parameter

What is the current behavior?

I create a parameter mask in excel 2016

What are the steps to reproduce?

Sorry for my bad english, for better explanation, i'm using images for example.

I'm need format a some cells with the Brazilian Real format. The library does not include this format by default.

I took the format used by Excel, using the program interface. When using within the library, the generated file does not apply the format.

Format gerated:
print1

With used:
print2

Final Result:
print3
print4

Which versions of PhpSpreadsheet and PHP are affected?

PHP: 7.1.9
Php Spreadsheet: 1.0 by composer.json

Most helpful comment

Use . for the decimal separator, , for the thousands separator in your format mask for PHPSpreadsheet.... the code is not locale-aware, and won't change it for you internally where the mask is always stored as . for decimals and , for thousands ; in MS Excel, localisation for thousands and decimal separators are handled within the Excel GUI.

ie.

->setFormatCode('R$ #,##0.00_-');

All 2 comments

Use . for the decimal separator, , for the thousands separator in your format mask for PHPSpreadsheet.... the code is not locale-aware, and won't change it for you internally where the mask is always stored as . for decimals and , for thousands ; in MS Excel, localisation for thousands and decimal separators are handled within the Excel GUI.

ie.

->setFormatCode('R$ #,##0.00_-');

are working, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexbog8 picture alexbog8  路  4Comments

leandrogm picture leandrogm  路  5Comments

PowerKiKi picture PowerKiKi  路  5Comments

smartlara picture smartlara  路  5Comments

isopen picture isopen  路  3Comments