Prevent overflow with zero precision
This commit is contained in:
@@ -1471,6 +1471,7 @@ TEST(FormatterTest, FormatDouble) {
|
||||
}
|
||||
|
||||
TEST(FormatterTest, PrecisionRounding) {
|
||||
EXPECT_EQ("0", format("{:.0f}", 0.1));
|
||||
EXPECT_EQ("0.000", format("{:.3f}", 0.00049));
|
||||
EXPECT_EQ("0.001", format("{:.3f}", 0.0005));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user