Support proper %g, %f, and %a float formatting

See #61
See #104
This commit is contained in:
Justine Tunney 2021-03-05 10:31:16 -08:00
parent e26bdbec52
commit f064183646
48 changed files with 1034 additions and 921 deletions

View file

@ -433,8 +433,7 @@ TEST(sprintf, test_float) {
EXPECT_STREQ("3.5", Format("%.1f", 3.49));
EXPECT_STREQ("a0.5 ", Format("a%-5.1f", 0.5));
EXPECT_STREQ("a0.5 end", Format("a%-5.1fend", 0.5));
/* out of range in the moment, need to be fixed by someone */
EXPECT_STREQ("inf", Format("%.1f", 1E20));
EXPECT_STREQ("100000000000000000000.0", Format("%.1f", 1E20));
}
TEST(sprintf, test_types) {