From: Eric Haszlakiewicz Date: Thu, 12 Sep 2013 02:09:43 +0000 (-0500) Subject: Issue #59: change the floating point output format to %.17g so values with more than... X-Git-Tag: json-c-0.12-20140410~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=06450206c4f3de4af8d81bb6d93e9db1d5fedec1;p=thirdparty%2Fjson-c.git Issue #59: change the floating point output format to %.17g so values with more than 6 digits show up in the output. --- diff --git a/json_object.c b/json_object.c index 118def76..faf61930 100644 --- a/json_object.c +++ b/json_object.c @@ -577,7 +577,7 @@ static int json_object_double_to_json_string(struct json_object* jso, else size = snprintf(buf, sizeof(buf), "-Infinity"); else - size = snprintf(buf, sizeof(buf), "%f", jso->o.c_double); + size = snprintf(buf, sizeof(buf), "%.17g", jso->o.c_double); p = strchr(buf, ','); if (p) {