Implement format specs in fmt::thousands

This commit is contained in:
Victor Zverovich
2021-09-04 06:47:21 -07:00
parent 3b9c442689
commit c4d0f96a6d
2 changed files with 21 additions and 2 deletions

View File

@@ -1596,7 +1596,8 @@ TEST(format_test, bytes) {
}
TEST(format_test, thousands) {
EXPECT_EQ(fmt::format("{}", fmt::thousands(1000)), "1,000");
EXPECT_EQ(fmt::format("{}", fmt::thousands(10000000)), "10,000,000");
EXPECT_EQ(fmt::format("{:8}", fmt::thousands(1000)), " 1,000");
}
enum test_enum { foo, bar };