go/src/pkg/fmt
Michael T. Jones 8cdee891d7 fmt: handle precision 0 format stings in standard way
The C-stdlib heritage of printf/fprintf/sprintf has two odd
aspects for precisions of zero with integers. First, the zero
can be specified in any of these ways, "%4.0d", "%.0d" and
"%.d" which was not previously supported here. Secondly, the
seemingly universal interpretation of precision for integers
is that precision==0 and value==0 means print nothing at all.
The code here now handles this for integers just as the code
in big/int.c does the same for the Int type. New tests are
added to fmt_test.go to verify these changes.

R=r, r
CC=golang-dev
https://golang.org/cl/4717045
2011-07-21 16:46:51 +10:00
..
Makefile build: no required environment variables 2010-08-18 10:08:49 -04:00
doc.go fmt: debugging formats for characters: %+q %#U 2011-06-11 00:03:02 +00:00
fmt_test.go fmt: handle precision 0 format stings in standard way 2011-07-21 16:46:51 +10:00
format.go fmt: handle precision 0 format stings in standard way 2011-07-21 16:46:51 +10:00
print.go fmt: handle precision 0 format stings in standard way 2011-07-21 16:46:51 +10:00
scan.go fmt: Scan(&int) was mishandling a lone zero. 2011-07-18 10:05:35 +10:00
scan_test.go fmt: Scan(&int) was mishandling a lone zero. 2011-07-18 10:05:35 +10:00
stringer_test.go delete float, complex - code changes 2011-01-19 23:09:00 -05:00