{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/35031","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/35031/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/35031/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/35031/events","html_url":"https://github.com/rust-lang/rust/issues/35031","id":167408373,"number":35031,"title":"Doc examples not helpful in std::fmt","user":{"login":"jonathandturner","id":547158,"avatar_url":"https://avatars.githubusercontent.com/u/547158?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathandturner","html_url":"https://github.com/jonathandturner","followers_url":"https://api.github.com/users/jonathandturner/followers","following_url":"https://api.github.com/users/jonathandturner/following{/other_user}","gists_url":"https://api.github.com/users/jonathandturner/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathandturner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathandturner/subscriptions","organizations_url":"https://api.github.com/users/jonathandturner/orgs","repos_url":"https://api.github.com/users/jonathandturner/repos","events_url":"https://api.github.com/users/jonathandturner/events{/privacy}","received_events_url":"https://api.github.com/users/jonathandturner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-25T16:25:38Z","updated_at":"2016-07-25T16:25:38Z","closed_at":null,"body":"Was just trying to read through std::fmt to understand how format values to a particular decimal point.  I came across this set of examples, which don't do a good job of explaining the output of each, so it's difficult to visually pattern match what I type in to what comes out:\r\n\r\n```rust\r\n// Hello {arg 0 (x)} is {arg 1 (0.01) with precision specified inline (5)}\r\nprintln!(\"Hello {0} is {1:.5}\", \"x\", 0.01);\r\n\r\n// Hello {arg 1 (x)} is {arg 2 (0.01) with precision specified in arg 0 (5)}\r\nprintln!(\"Hello {1} is {2:.0$}\", 5, \"x\", 0.01);\r\n\r\n// Hello {arg 0 (x)} is {arg 2 (0.01) with precision specified in arg 1 (5)}\r\nprintln!(\"Hello {0} is {2:.1$}\", \"x\", 5, 0.01);\r\n\r\n// Hello {next arg (x)} is {second of next two args (0.01) with precision\r\n//                          specified in first of next two args (5)}\r\nprintln!(\"Hello {} is {:.*}\",    \"x\", 5, 0.01);\r\n\r\n// Hello {next arg (x)} is {arg 2 (0.01) with precision\r\n//                          specified in its predecessor (5)}\r\nprintln!(\"Hello {} is {2:.*}\",   \"x\", 5, 0.01);\r\n\r\n// Hello {next arg (x)} is {arg \"number\" (0.01) with precision specified\r\n//                          in arg \"prec\" (5)}\r\nprintln!(\"Hello {} is {number:.prec$}\", \"x\", prec = 5, number = 0.01);\r\n```"}}
{"actor":{"display_login":"jonathandturner"}}