JsonDeserializer: use float when the value has few digits

This commit is contained in:
Benoit Blanchon committed 2024-09-04 14:33:14 +02:00
1 parent fd6314e132
commit 1f7a3f3174
8 files changed
+163 -28

No files matched your search

+1 -1
View File
@@ -203,7 +203,7 @@ TEST_CASE("JsonVariant::as()") {
REQUIRE(variant.as<bool>() == true);
REQUIRE(variant.as<long>() == 4L);
REQUIRE(variant.as<double>() == 4.2);
REQUIRE(variant.as<double>() == Approx(4.2));
REQUIRE(variant.as<const char*>() == "4.2"_s);
REQUIRE(variant.as<std::string>() == "4.2"_s);
REQUIRE(variant.as<JsonString>() == "4.2");