cwiggo cwiggo - 1 year ago 591
PHP Question

Formatting a cell to a percentage in PHPExcel

I am automating an excel spreadsheet using PHP.

I have been looking for a way to pragmatically format a cell to a percentage in PHPExcel.

I want to change a value like




Is there a solution for this?

Thanks in advance.

Answer Source

assuming your cell is A1 ..

            'code' => PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download