{"%x", ^uint32(0), "ffffffff"},
{"%X", ^uint64(0), "FFFFFFFFFFFFFFFF"},
{"%.20b", 7, "00000000000000000111"},
+ {"%6.0d", 0, " "},
{"%10d", 12345, " 12345"},
{"%10d", -12345, " -12345"},
{"%+10d", 12345, " +12345"},
// fmt_integer formats signed and unsigned integers.
func (f *fmt) fmt_integer(u uint64, base int, isSigned bool, digits string) {
- // precision of 0 and value of 0 means "print nothing"
+ // Precision of 0 and value of 0 means "print nothing" but padding.
if f.precPresent && f.prec == 0 && u == 0 {
+ if f.widPresent {
+ f.writePadding(f.wid)
+ }
return
}