{"action":"created","issue":{"url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/357","repository_url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet","labels_url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/357/labels{/name}","comments_url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/357/comments","events_url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/357/events","html_url":"https://github.com/PHPOffice/PhpSpreadsheet/issues/357","id":293956012,"number":357,"title":"PHP 7.1: Numbers shown with scientific notation even if explicitely formatted as text","user":{"login":"oveach","id":312756,"avatar_url":"https://avatars3.githubusercontent.com/u/312756?v=4","gravatar_id":"","url":"https://api.github.com/users/oveach","html_url":"https://github.com/oveach","followers_url":"https://api.github.com/users/oveach/followers","following_url":"https://api.github.com/users/oveach/following{/other_user}","gists_url":"https://api.github.com/users/oveach/gists{/gist_id}","starred_url":"https://api.github.com/users/oveach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oveach/subscriptions","organizations_url":"https://api.github.com/users/oveach/orgs","repos_url":"https://api.github.com/users/oveach/repos","events_url":"https://api.github.com/users/oveach/events{/privacy}","received_events_url":"https://api.github.com/users/oveach/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-02T16:59:37Z","updated_at":"2018-02-11T07:04:20Z","closed_at":"2018-02-11T07:04:20Z","author_association":"NONE","body":"This is:\r\n\r\n```\r\n- [x] a bug report\r\n```\r\n\r\nWith PHP 7.1, if I put a number in a cell and set explicitely a text format, it's shown with scientific notation in Excel, instead of showing the number \"as is\".\r\n\r\nMaybe related with this BC break introduced in 7.1?\r\nhttps://secure.php.net/manual/fr/migration71.incompatible.php#migration71.incompatible.numerical-strings-scientific-notation\r\n\r\nIt's worth to know that it works perfectly fine in LibreOffice 5.4!\r\n\r\n### What is the expected behavior?\r\nNumbers shown as real text (ex : 150000197301), because I explicitely specify a text format style.\r\n\r\n### What is the current behavior?\r\nNumbers shown with scientific notation (ex: 1,5E+11).\r\n\r\n### What are the steps to reproduce?\r\nThe following code works as expected with PHP 5.6 (value shown = 150000197301), but fails with PHP 7.1 (value shown = 1,5E+11).\r\n```php\r\n<?php\r\nrequire 'vendor/autoload.php';\r\n$data = array('foo' => '150000197301');\r\n$spreadsheet = new \\PhpOffice\\PhpSpreadsheet\\Spreadsheet();\r\n$sheet = $spreadsheet->getSheet(0);\r\n$sheet->fromArray($data, null, 'A1');\r\n$sheet->getStyle('A1:A1')\r\n    ->getNumberFormat()\r\n    ->setFormatCode(\\PhpOffice\\PhpSpreadsheet\\Style\\NumberFormat::FORMAT_TEXT);\r\n$writer = new \\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx($spreadsheet);\r\n$filename = 'test_' . PHP_VERSION . '.xlsx';\r\n$writer->save($filename);\r\n```\r\n\r\n### Which versions of PhpSpreadsheet and PHP are affected?\r\nPhpSpreasheet 1.1.0\r\nPHP 7.1.2\r\nTested on Windows french and Excel 2016 french."},"comment":{"url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/comments/364728348","html_url":"https://github.com/PHPOffice/PhpSpreadsheet/issues/357#issuecomment-364728348","issue_url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/357","id":364728348,"user":{"login":"PowerKiKi","id":72603,"avatar_url":"https://avatars0.githubusercontent.com/u/72603?v=4","gravatar_id":"","url":"https://api.github.com/users/PowerKiKi","html_url":"https://github.com/PowerKiKi","followers_url":"https://api.github.com/users/PowerKiKi/followers","following_url":"https://api.github.com/users/PowerKiKi/following{/other_user}","gists_url":"https://api.github.com/users/PowerKiKi/gists{/gist_id}","starred_url":"https://api.github.com/users/PowerKiKi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PowerKiKi/subscriptions","organizations_url":"https://api.github.com/users/PowerKiKi/orgs","repos_url":"https://api.github.com/users/PowerKiKi/repos","events_url":"https://api.github.com/users/PowerKiKi/events{/privacy}","received_events_url":"https://api.github.com/users/PowerKiKi/received_events","type":"User","site_admin":false},"created_at":"2018-02-11T07:04:20Z","updated_at":"2018-02-11T07:04:20Z","author_association":"OWNER","body":"I actually cannot reproduce that on PHP 7.1 nor 7.2. I'll close it for now. But feel free to comment further if you find out how to reproduce systematically.\r\n\r\n![image](https://user-images.githubusercontent.com/72603/36070761-2432af0c-0f45-11e8-95f5-c7b8e6c4376d.png)\r\n"}}
{"actor":{"display_login":"PowerKiKi"}}