{"action":"created","issue":{"url":"https://api.github.com/repos/fmtlib/fmt/issues/597","repository_url":"https://api.github.com/repos/fmtlib/fmt","labels_url":"https://api.github.com/repos/fmtlib/fmt/issues/597/labels{/name}","comments_url":"https://api.github.com/repos/fmtlib/fmt/issues/597/comments","events_url":"https://api.github.com/repos/fmtlib/fmt/issues/597/events","html_url":"https://github.com/fmtlib/fmt/issues/597","id":271171328,"number":597,"title":"Enhancement: provide custom locale to fmt::format","user":{"login":"kivadiu","id":3123190,"avatar_url":"https://avatars1.githubusercontent.com/u/3123190?v=4","gravatar_id":"","url":"https://api.github.com/users/kivadiu","html_url":"https://github.com/kivadiu","followers_url":"https://api.github.com/users/kivadiu/followers","following_url":"https://api.github.com/users/kivadiu/following{/other_user}","gists_url":"https://api.github.com/users/kivadiu/gists{/gist_id}","starred_url":"https://api.github.com/users/kivadiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kivadiu/subscriptions","organizations_url":"https://api.github.com/users/kivadiu/orgs","repos_url":"https://api.github.com/users/kivadiu/repos","events_url":"https://api.github.com/users/kivadiu/events{/privacy}","received_events_url":"https://api.github.com/users/kivadiu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-04T06:43:00Z","updated_at":"2017-11-04T13:58:08Z","closed_at":null,"author_association":"NONE","body":"The library is extremely useful so that I would like to use it everywhere but it uses snprintf to print floats which uses the global locale.\r\n\r\nOne problem is when the global locale is set to a language specific locale and you still want to write some numbers with the C locale. Or you may just want to write with different locales in the same program.\r\n\r\nChanging the global locale when you call `fmt::format` is not thread safe, so:\r\n1. is there a solution today to force the C locale in `fmt::format` if the global locale is different?\r\n2. if not, would it be possible to have something like `fmt::format(locale_name, \"format\", arg1, arg2, ...);`\r\nbut I guess this would mean to rewrite snprintf?"},"comment":{"url":"https://api.github.com/repos/fmtlib/fmt/issues/comments/341898930","html_url":"https://github.com/fmtlib/fmt/issues/597#issuecomment-341898930","issue_url":"https://api.github.com/repos/fmtlib/fmt/issues/597","id":341898930,"user":{"login":"foonathan","id":9192733,"avatar_url":"https://avatars2.githubusercontent.com/u/9192733?v=4","gravatar_id":"","url":"https://api.github.com/users/foonathan","html_url":"https://github.com/foonathan","followers_url":"https://api.github.com/users/foonathan/followers","following_url":"https://api.github.com/users/foonathan/following{/other_user}","gists_url":"https://api.github.com/users/foonathan/gists{/gist_id}","starred_url":"https://api.github.com/users/foonathan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foonathan/subscriptions","organizations_url":"https://api.github.com/users/foonathan/orgs","repos_url":"https://api.github.com/users/foonathan/repos","events_url":"https://api.github.com/users/foonathan/events{/privacy}","received_events_url":"https://api.github.com/users/foonathan/received_events","type":"User","site_admin":false},"created_at":"2017-11-04T13:58:08Z","updated_at":"2017-11-04T13:58:08Z","author_association":"COLLABORATOR","body":"A couple of years ago I wrote such an implementation, I can look tomorrow whether I can find it"}}
{"actor":{"display_login":"foonathan"}}