From 7a9dcaacbe15d95a1fdfa299ef05fd0b0535736b Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 31 Jul 2012 15:35:57 +0200 Subject: [PATCH] Add precision specifier for floating point numbers. --- third-party/cJSON/cJSON.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third-party/cJSON/cJSON.c b/third-party/cJSON/cJSON.c index eb7c2f9d0..263f2f9f2 100644 --- a/third-party/cJSON/cJSON.c +++ b/third-party/cJSON/cJSON.c @@ -131,7 +131,7 @@ static char *print_number(cJSON *item) if (str) { if (fabs(floor(d)-d)<=DBL_EPSILON) sprintf(str,"%.0f",d); - else if (fabs(d)<1.0e-6 || fabs(d)>1.0e9) sprintf(str,"%e",d); + else if (fabs(d)<1.0e-6 || fabs(d)>1.0e9) sprintf(str,"%.16e",d); else sprintf(str,"%f",d); } }