Last active
November 13, 2023 07:30
-
-
Save AlbinSoft/6f64aea9df2d267f25ae84c08a4b874a to your computer and use it in GitHub Desktop.
PhpSpreadsheet format Euros with decimals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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