{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/4916","repository_url":"https://api.github.com/repos/elixir-lang/elixir","labels_url":"https://api.github.com/repos/elixir-lang/elixir/issues/4916/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/4916/comments","events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/4916/events","html_url":"https://github.com/elixir-lang/elixir/pull/4916","id":163224623,"number":4916,"title":"Pretty print numbers with underscore as digit separator","user":{"login":"wojtekmach","id":76071,"avatar_url":"https://avatars.githubusercontent.com/u/76071?v=3","gravatar_id":"","url":"https://api.github.com/users/wojtekmach","html_url":"https://github.com/wojtekmach","followers_url":"https://api.github.com/users/wojtekmach/followers","following_url":"https://api.github.com/users/wojtekmach/following{/other_user}","gists_url":"https://api.github.com/users/wojtekmach/gists{/gist_id}","starred_url":"https://api.github.com/users/wojtekmach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojtekmach/subscriptions","organizations_url":"https://api.github.com/users/wojtekmach/orgs","repos_url":"https://api.github.com/users/wojtekmach/repos","events_url":"https://api.github.com/users/wojtekmach/events{/privacy}","received_events_url":"https://api.github.com/users/wojtekmach/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":27,"created_at":"2016-06-30T17:48:07Z","updated_at":"2016-07-03T15:35:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/4916","html_url":"https://github.com/elixir-lang/elixir/pull/4916","diff_url":"https://github.com/elixir-lang/elixir/pull/4916.diff","patch_url":"https://github.com/elixir-lang/elixir/pull/4916.patch"},"body":"Discussed on https://groups.google.com/forum/#!topic/elixir-lang-core/trxIuhky0a8\r\n\r\n\r\nAs discussed on ML, all integers are now \"pretty printed\" by default. I also added the same behavior for floats for consistency. Thus:\r\n\r\n    iex(1)> 1000\r\n    1_000\r\n\r\n    iex(2)> 1_000.001\r\n    1_000.001\r\n\r\n    iex(3)> i 1000\r\n    Term\r\n      1_000\r\n    Data type\r\n      Integer\r\n    Reference modules\r\n      Integer\r\n\r\n    # tests\r\n\r\n    test \"the truth\" do\r\n      assert 10000 == 10001\r\n    end\r\n\r\n    1) test the truth (BarTest)\r\n       test/bar_test.exs:5\r\n       Assertion with == failed\r\n       code: 10_000 == 10_001\r\n       lhs:  10_000\r\n       rhs:  10_001\r\n       stacktrace:\r\n         test/bar_test.exs:6: (test)\r\n\r\nOpen questions:\r\n- how should we call the option to disable this behavior? Perhaps `%Inspect.Opts{pretty_numbers true/false}` or `digit_separator: true/false`?"},"comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments/230159381","html_url":"https://github.com/elixir-lang/elixir/pull/4916#issuecomment-230159381","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/4916","id":230159381,"user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"created_at":"2016-07-03T15:35:54Z","updated_at":"2016-07-03T15:35:54Z","body":"Ok, so let's take a step back. We have started this discussion when we introduced digits_separator. However, `inspect` is for printing Elixir terms, so it wouldn't make much sense to use it as digits_separator: \",\" IMO.\r\n\r\nFrom a developer perspective, it seems the biggest contention point is when to start introducing the separators in the first place. So we can either introduce an option that makes this configurable (with a special value meaning never) or we have an atom flag that configures it generally, something like: `digit_separator: :always | :never | :integer | :float`.\r\n\r\nBesides that, I am a bit uncomfortable with the float behaviour, where we don't separate the decimal points."}}
{"actor":{"display_login":"josevalim"}}