From 06450206c4f3de4af8d81bb6d93e9db1d5fedec1 Mon Sep 17 00:00:00 2001 From: Eric Haszlakiewicz Date: Wed, 11 Sep 2013 21:09:43 -0500 Subject: [PATCH] Issue #59: change the floating point output format to %.17g so values with more than 6 digits show up in the output. --- json_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json_object.c b/json_object.c index 118def7..faf6193 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) { -- 2.49.0