{"action":"opened","issue":{"url":"https://api.github.com/repos/nlohmann/json/issues/302","repository_url":"https://api.github.com/repos/nlohmann/json","labels_url":"https://api.github.com/repos/nlohmann/json/issues/302/labels{/name}","comments_url":"https://api.github.com/repos/nlohmann/json/issues/302/comments","events_url":"https://api.github.com/repos/nlohmann/json/issues/302/events","html_url":"https://github.com/nlohmann/json/issues/302","id":174654294,"number":302,"title":"Parsing of floats locale dependent","user":{"login":"jomade","id":1391236,"avatar_url":"https://avatars.githubusercontent.com/u/1391236?v=3","gravatar_id":"","url":"https://api.github.com/users/jomade","html_url":"https://github.com/jomade","followers_url":"https://api.github.com/users/jomade/followers","following_url":"https://api.github.com/users/jomade/following{/other_user}","gists_url":"https://api.github.com/users/jomade/gists{/gist_id}","starred_url":"https://api.github.com/users/jomade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jomade/subscriptions","organizations_url":"https://api.github.com/users/jomade/orgs","repos_url":"https://api.github.com/users/jomade/repos","events_url":"https://api.github.com/users/jomade/events{/privacy}","received_events_url":"https://api.github.com/users/jomade/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-02T00:13:57Z","updated_at":"2016-09-02T00:13:57Z","closed_at":null,"body":"With version 2.0.3, the following code: \r\n```\r\nstd::locale l(\"\");\r\nstd::string curr_locale = l.name();\r\nfloat j = nlohmann::json::parse(\"0.1\");\r\nstd::setlocale(LC_ALL, \"en_US.UTF-8\");\r\nfloat k = nlohmann::json::parse(\"0.1\");\r\n```\r\nyields the following results (read in the debugger): \r\n`curr_locale = \"nb_NO.UTF-8\"`\r\n`j = 0`\r\n`k = 0.100000001`\r\n\r\nThus, the decimals are truncated in the Norwegian locale. This is rather unexpected, and should IMO not happen. \r\n\r\nI think it originates from the parser calling strtod which is locale dependent. "}}
{"actor":{"display_login":"jomade"}}