PHPOffice / PHPExcel

ARCHIVED
Other
11.46k stars 4.19k forks source link

Accounting Number Format #854

Open michaelnguyen2021 opened 8 years ago

michaelnguyen2021 commented 8 years ago

I think we should add Accounting Number Format (as click the $ button in Excel) to NumberFormat class

Found the format code on StackOver (http://stackoverflow.com/questions/5669941/phpexcel-accounting-formats )

$objPHPExcel->getActiveSheet()->getStyle($cell)->getNumberFormat()
->setFormatCode('_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)');

I test and it works as expected

MarkBaker commented 8 years ago

There's nothing to stop you defining additional formats in your own code, they're simply strings as you see