PhpSpreadsheet
PhpSpreadsheet copied to clipboard
Want Constant for Formatting Integer Using Thousands Separator
I need to format numbers with thousands separators and no decimals like this:
const FORMAT_NUMBER_COMMA_SEPARATED3 = '#,##0';
Adding a PR to fix.
Hmm - just found in the docs:
https://phpspreadsheet.readthedocs.io/en/latest/topics/accessing-cells/#setting-a-number-with-leading-zeroes
$spreadsheet->getActiveSheet()->getStyle('A9')
->getNumberFormat()
->setFormatCode(
'00000000000'
);
Seems to work with #,##0 but not [$£-809]#,##0.00;-[$£-809]#,##0.00
Your new case seems to be different from the original. Please open a separate issue for it.