accounting format

Topics: User Forum
Aug 21, 2012 at 2:46 PM

Does anyone know if the accounting format for cells has been implemented in PHPExcel?  I couldn't find it anywhere.

Thanks

Mike

Aug 21, 2012 at 3:50 PM
Edited Aug 21, 2012 at 3:50 PM

If anyone is looking for this in the future, I was able to figure it out.  I found this thread on SO: http://stackoverflow.com/questions/5669941/phpexcel-accounting-formats

 

From that I added this line of code into NumberFormat.php in the pre-defined  formats section:

 

const FORMAT_ACCOUNTING			= '_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)';

 

 

Maybe this will help someone else.

Thanks

Mike

Coordinator
Aug 21, 2012 at 5:21 PM

You aren't restricted to the built-in formats, but can set your number format masks to any valid Excel number format string