Fix width computation in float formatter

This commit is contained in:
Victor Zverovich
2021-01-15 11:07:55 -08:00
parent f8c2f8480a
commit 532e846b86
2 changed files with 4 additions and 2 deletions

View File

@@ -871,6 +871,7 @@ TEST(FormatterTest, Width) {
EXPECT_EQ(format("{:*^5}", "🤡"), "**🤡**");
EXPECT_EQ(format("{:#6}", 42.0), " 42.0");
EXPECT_EQ(format("{:6c}", static_cast<int>('x')), "x ");
EXPECT_EQ(format("{:>06.0f}", 0.00884311), "000000");
}
template <typename T> inline T const_check(T value) { return value; }