Remove hard-coded precision for printing JSON float values
authorVincent Fu <Vincent.Fu@sandisk.com>
Mon, 13 Jun 2016 16:37:24 +0000 (12:37 -0400)
committerJens Axboe <axboe@fb.com>
Tue, 28 Jun 2016 20:02:16 +0000 (14:02 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
json.c

diff --git a/json.c b/json.c
index f3ec0bb..190fa9e 100644 (file)
--- a/json.c
+++ b/json.c
@@ -347,7 +347,7 @@ static void json_print_value(struct json_value *value, struct buf_output *out)
                log_buf(out, "%lld", value->integer_number);
                break;
        case JSON_TYPE_FLOAT:
-               log_buf(out, "%.2f", value->float_number);
+               log_buf(out, "%f", value->float_number);
                break;
        case JSON_TYPE_OBJECT:
                json_print_object(value->object, out);