Skip to content

Instantly share code, notes, and snippets.

@AlbinSoft
Last active November 13, 2023 07:30
Show Gist options
  • Save AlbinSoft/6f64aea9df2d267f25ae84c08a4b874a to your computer and use it in GitHub Desktop.
Save AlbinSoft/6f64aea9df2d267f25ae84c08a4b874a to your computer and use it in GitHub Desktop.
PhpSpreadsheet format Euros with decimals
After reading several solutions in forums this is what worked for me
$sheet->setCellValue('A1', number_format(1234.5, 2, '.', ''));
$sheet->getStyle('A1')->getNumberFormat()->setFormatCode('#,##0.00 "€"_-');
Must write: 1,234.50 €
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment