Handle negative exponent and rename value/pow10 to numerator/denominator

This commit is contained in:
Victor Zverovich
2019-10-13 12:50:48 -07:00
parent f7a5748fd3
commit 1cbc5fa6cb
4 changed files with 127 additions and 67 deletions
+9
View File
@@ -55,3 +55,12 @@ TEST(GrisuTest, Prettify) {
}
TEST(GrisuTest, ZeroPrecision) { EXPECT_EQ("1", fmt::format("{:.0}", 1.0)); }
TEST(GrisuTest, Fallback) {
EXPECT_EQ("1e+23", fmt::format("{}", 1e23));
EXPECT_EQ("9e-265", fmt::format("{}", 9e-265));
EXPECT_EQ("5.423717798060526e+125",
fmt::format("{}", 5.423717798060526e+125));
EXPECT_EQ("1.372371880954233e-288",
fmt::format("{}", 1.372371880954233e-288));
}