Skip to content
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

fmt: misleading description of %g and %G verbs #9012

Closed
gopherbot opened this issue Oct 29, 2014 · 4 comments
Closed

fmt: misleading description of %g and %G verbs #9012

gopherbot opened this issue Oct 29, 2014 · 4 comments

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Oct 29, 2014

by alex@zor.io:

http://golang.org/pkg/fmt describes the '%g' verb as 'whichever of %e or %f produces
more compact output' (and similar for '%G').

This is surprising because '%g' may give different output (due to different precision)
to both '%e' and '%f', as is explained a few paragraphs lower in the document.

Suggestion is to clarify the descriptions in the verb table for '%g' and '%G' to make
this clear.
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Oct 29, 2014

Comment 1:

Labels changed: added repo-main, release-none, documentation.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Oct 29, 2014

Comment 2:

CL https://golang.org/cl/169730043 mentions this issue.
@robpike
Copy link
Contributor

@robpike robpike commented Oct 29, 2014

Comment 3:

This issue was closed by revision c88ba19.

Status changed to Fixed.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Oct 29, 2014

Comment 4 by alex@zor.io:

Hello,
The change still implies that %g gives you one of (%e,%f), but it is not the case.
Therefore the aspect of this that is misleading is unchanged.
See playground: http://play.golang.org/p/_CVk7__2HL
@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman added a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
It now echoes what strconv.FormatFloat says.

Fixes golang#9012.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/169730043
wheatman added a commit to wheatman/go-akaros that referenced this issue Jun 26, 2018
It now echoes what strconv.FormatFloat says.

Fixes golang#9012.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/169730043
wheatman added a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
It now echoes what strconv.FormatFloat says.

Fixes golang#9012.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/169730043
wheatman added a commit to wheatman/go-akaros that referenced this issue Jul 20, 2018
It now echoes what strconv.FormatFloat says.

Fixes golang#9012.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/169730043
wheatman added a commit to wheatman/go-akaros that referenced this issue Jul 30, 2018
It now echoes what strconv.FormatFloat says.

Fixes golang#9012.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/169730043
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.