You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
http://play.golang.org/p/FT7yR1p4-_
What is the expected output?
I expect both lines of output to be identical.
What do you see instead?
The output from "%7g" is not limited to 7 characters, but from "%7f"
it is.
Which compiler are you using (5g, 6g, 8g, gccgo)?
Which operating system are you using?
Which version are you using? (run 'go version')
Please provide any additional information below.
The text was updated successfully, but these errors were encountered:
The 7s in your example are doing nothing. Change them to 20s and
you'll see what they do. We should make the docs clearer.
godoc fmt:
%e scientific notation, e.g. -1234.456e+78
%E scientific notation, e.g. -1234.456E+78
%f decimal point but no exponent, e.g. 123.456
%g whichever of %e or %f produces more compact output
%G whichever of %E or %f produces more compact output
...
For numeric values, width sets the width of the field and precision sets
the number of places after the decimal, if appropriate. For example, the
format %6.2f prints 123.45.
For strings, width is the minimum number of characters to output,
padding with spaces if necessary, and precision is the maximum number of
characters to output, truncating if necessary.
Missing: (1) for numeric values, width sets the *minimum* width of the field.
(2) Default precision for e and f is 6; default precision for g is the smallest
number of digits needed to uniquely identify the value.
by chris.jones.yar:
The text was updated successfully, but these errors were encountered: