GNOME Bugzilla – Bug 753763
[PATCH] Don't loose decimal in whole-double -> string conversion
Last modified: 2017-03-13 11:36:31 UTC
Created attachment 309471 [details] [review] Patch to avoid whole-double losing their decimal When converting json to its string representation, whole-doubles (such as 1.0) would be converted into strings without decimals ("1"). That can be inconvenient e.g. when converting from/to GVariants.
Review of attachment 309471 [details] [review]: ::: json-glib/tests/gvariant.c @@ +159,3 @@ { "/string-to-uint64", "(t)", "(uint64 1999999999999999,)", "[\"1999999999999999\"]" }, { "/string-to-double", "(d)", "(1.23,)", "[\"1.23\"]" }, + { "/string-to-double-whole", "(d)", "(123.0,)", "[\"123.0\"]" }, This seems to undo the changes we were testing with bug 724319.
Yes -- in fact the it seems this change avoids the problem in bug 724319 altogether; and the test-program attached to that bug still works.
Review of attachment 309471 [details] [review]: Okay, let's go with it.
Attachment 309471 [details] pushed to master