-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::fmt
needs doc for precision := '*'
case
#24656
Comments
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
Apr 21, 2015
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
Apr 24, 2015
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
Apr 24, 2015
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
Apr 25, 2015
Fixes rust-lang#24656 r? @pnkfelix I just added the examples, but if the wording needs expanded too, let me know what you think should be added :)
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
Apr 25, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I spent a while looking at http://doc.rust-lang.org/nightly/std/fmt/index.html#syntax and comparing it against the rest of the API documentation there, but I saw no discussion of the meaning of the asterisk precision, e.g. what the format string
"{:.*}"
denotes.The error message you get when you try to use it incorrectly is pretty inscrutable:
yields
Manual experimentation seems to indicate that the meaning of
{:.*}
is that the next two parameters are consumed, where the first represents the fractional precision and the second the value to be printed.As a concrete example, the following four statements all print the same thing:
namely:
The text was updated successfully, but these errors were encountered: