]> Cypherpunks repositories - gostls13.git/commit
fmt: support sharp flag for float and complex value printing
authorMartin Möhrmann <moehrmann@google.com>
Wed, 15 Feb 2017 11:41:02 +0000 (12:41 +0100)
committerMartin Möhrmann <moehrmann@google.com>
Sun, 19 Feb 2017 07:18:56 +0000 (07:18 +0000)
commite97f407ec164174187d6fbb2f7332d6fb3176e9e
tree69885cb11bb93799512490d4fcb3cce9f493d2d3
parent1e69aefb7e7ed34f8e425287b126b0f3edbf144e
fmt: support sharp flag for float and complex value printing

Added an alternate form of printing floats and complex values
by specifying the sharp flag.

Output formatted using the the verbs v, e, E, f, F, g and G in
combination with the sharp flag will always include a decimal point.

The alternate form specified by the sharp flag for %g and %G verbs
will not truncate trailing zeros and assume a default precision of 6.

Fixes #18857.

Change-Id: I4d776239e06d7a6a90f2d8556240a359888cb7c3
Reviewed-on: https://go-review.googlesource.com/37051
Reviewed-by: Rob Pike <r@golang.org>
src/fmt/doc.go
src/fmt/fmt_test.go
src/fmt/format.go