Removed configurable number of decimal places (issues #288, #427 and #506)

This commit is contained in:
Benoit Blanchon
2017-05-20 09:06:53 +02:00
parent 639286f8b6
commit cda05aec04
33 changed files with 447 additions and 391 deletions

View File

@ -76,17 +76,10 @@ TEST_CASE("JsonObject::printTo()") {
check(obj, "{\"a\":[1,2],\"b\":[4,5]}");
}
SECTION("TwoDoublesFourDigits") {
obj["a"] = double_with_n_digits(3.14159265358979323846, 4);
obj.set("b", 2.71828182845904523536, 4);
obj.set("c", double_with_n_digits(3.14159265358979323846, 3));
check(obj, "{\"a\":3.1416,\"b\":2.7183,\"c\":3.142}");
}
SECTION("TwoDoubleDefaultDigits") {
obj["a"] = 3.14159265358979323846;
obj.set("b", 2.71828182845904523536);
check(obj, "{\"a\":3.14,\"b\":2.72}");
SECTION("Two doubles") {
obj["a"] = 12.34;
obj.set("b", 56.78);
check(obj, "{\"a\":12.34,\"b\":56.78}");
}
SECTION("TwoNull") {