From 932b593a582272c4f9a5e8d32224bf64603d972f Mon Sep 17 00:00:00 2001 From: ktkk Date: Fri, 10 Oct 2025 15:03:04 +0000 Subject: [PATCH] Use %g instead of %f for double formatting This can probably be refined further. This is just an improvement to get rid of unnecessary trailing zeroes. --- json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json.c b/json.c index f3062b3..01b018c 100644 --- a/json.c +++ b/json.c @@ -117,7 +117,7 @@ void json_add_long(Json* json, long value) void json_add_double(Json* json, double value) { begin_value(json); - fprintf(json->stream, "%f", value); + fprintf(json->stream, "%g", value); end_value(json); }