Fix handling of small precision in general format

This commit is contained in:
Victor Zverovich
2020-03-24 09:01:57 -07:00
parent 01a172c969
commit 69779b4ed6
2 changed files with 5 additions and 2 deletions

View File

@@ -1125,6 +1125,7 @@ TEST(FormatterTest, Precision) {
format("{:.838A}", -2.14001164E+38));
EXPECT_EQ("123.", format("{:#.0f}", 123.0));
EXPECT_EQ("1.23", format("{:.02f}", 1.234));
EXPECT_EQ("0.001", format("{:.1g}", 0.001));
EXPECT_THROW_MSG(format("{0:.2}", reinterpret_cast<void*>(0xcafe)),
format_error,