From: Keith Busch Date: Fri, 15 Jun 2018 19:28:11 +0000 (-0600) Subject: Fix json output of 128-bit numbers X-Git-Tag: v1.6~18 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7c61d60d3eed609a5151a057932f24608e56f543;p=users%2Fsagi%2Fnvme-cli.git Fix json output of 128-bit numbers We use the long float for only very large integers. We don't want to see the decimal, and the locale settings could cause different output, so let's remove it. Link: https://github.com/linux-nvme/nvme-cli/issues/354 Signed-off-by: Keith Busch --- diff --git a/json.c b/json.c index 9f8f8d75..d2f9fb73 100644 --- a/json.c +++ b/json.c @@ -394,7 +394,7 @@ static void json_print_value(struct json_value *value, void *out) printf( "%llu", value->uint_number); break; case JSON_TYPE_FLOAT: - printf( "%Lf", value->float_number); + printf( "%.0Lf", value->float_number); break; case JSON_TYPE_OBJECT: json_print_object(value->object, out);