mk-j / PHP_XLSXWriter

Lightweight XLSX Excel Spreadsheet Writer in PHP
MIT License
1.84k stars 665 forks source link

Update xlsxwriter.class.php to avoid malformed files in PHP < 8.0.0 #345

Open xaviermdq opened 1 year ago

xaviermdq commented 1 year ago

Modified float to string casting conversion in several methods to always use '.' as decimal separator for PHP < 8.0.0 From PHP manual: "As of PHP 8.0.0, the decimal point character is always '.'. Prior to PHP 8.0.0, the decimal point character is defined in the script's locale (categoryLC_NUMERIC). See the setlocale() function." I used setlocale but may be we can use sprintf or number_format. I'm not sure which is the best way to achieve this.