Default constants are defined only for dollars and euros, but PHPExcel does not limit you to just these constant constants. They are just strings; and you can set any valid MS Excel format code as a numberFormat mask by simply setting it to the corresponding string value. It is generally not recommended to add your own constants to numberFormat.php, although you need to remember to add them each time you upgrade to a new version of PHPExcel ... it is better to define additional constants in your own code.
You can apply the currency format to cells using:
$objPHPExcel->getActiveSheet() ->getStyle('E4:E13') ->getNumberFormat() ->setFormatCode( '_-* #,##0.00\ [$zł-415]_-' );
Or, if you define a new constant using
define('FORMAT_CURRENCY_PLN_1', '_-* #,##0.00\ [$zł-415]_-');
then you can apply it to your cells using
$objPHPExcel->getActiveSheet() ->getStyle('E4:E13') ->getNumberFormat() ->setFormatCode( FORMAT_CURRENCY_PLN_1 );
Mark baker
source share