Skip to content

Commit eaf2097

Browse files
committed
add tests for checking float with #(sharp) flag
1 parent eb8c955 commit eaf2097

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/fmt/fmt_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,11 @@ var fmtTests = []struct {
463463
{"%#.4x", 1.0, "0x1.0000p+00"},
464464
{"%#.4g", 1.0, "1.000"},
465465
{"%#.4g", 100000.0, "1.000e+05"},
466+
{"%#.4g", 1.234, "1.234"},
467+
{"%#.4g", 0.1234, "0.1234"},
466468
{"%#.4g", 1.23, "1.230"},
467469
{"%#.4g", 0.123, "0.1230"},
470+
{"%#.4g", 1.2, "1.200"},
468471
{"%#.4g", 0.12, "0.1200"},
469472
{"%#.0f", 123.0, "123."},
470473
{"%#.0e", 123.0, "1.e+02"},

0 commit comments

Comments
 (0)