Don't print trailing zero with fixed, precision=0, and showpoint (#1417)

This commit is contained in:
Victor Zverovich
2019-11-24 08:22:18 -08:00
parent 43271ba8e8
commit 28d7191c27
2 changed files with 10 additions and 5 deletions

View File

@@ -1212,6 +1212,7 @@ TEST(FormatterTest, Precision) {
"012970999954193198940908041656332452475714786901472678015935523861155013"
"480352649347201937902681071074917033322268447533357208324319361e-324",
format("{:.494}", 4.9406564584124654E-324));
EXPECT_EQ("123.", format("{:#.0f}", 123.0));
EXPECT_THROW_MSG(format("{0:.2}", reinterpret_cast<void*>(0xcafe)),
format_error,