diff options
-rw-r--r-- | qapi/string-output-visitor.c | 2 | ||||
-rw-r--r-- | tests/test-string-output-visitor.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/qapi/string-output-visitor.c b/qapi/string-output-visitor.c index 92b030521..34e525ead 100644 --- a/qapi/string-output-visitor.c +++ b/qapi/string-output-visitor.c @@ -52,7 +52,7 @@ static void print_type_number(Visitor *v, double *obj, const char *name, Error **errp) { StringOutputVisitor *sov = DO_UPCAST(StringOutputVisitor, visitor, v); - string_output_set(sov, g_strdup_printf("%g", *obj)); + string_output_set(sov, g_strdup_printf("%f", *obj)); } char *string_output_get_string(StringOutputVisitor *sov) diff --git a/tests/test-string-output-visitor.c b/tests/test-string-output-visitor.c index 22909b84e..608f14a5d 100644 --- a/tests/test-string-output-visitor.c +++ b/tests/test-string-output-visitor.c @@ -84,7 +84,7 @@ static void test_visitor_out_number(TestOutputVisitorData *data, str = string_output_get_string(data->sov); g_assert(str != NULL); - g_assert_cmpstr(str, ==, "3.14"); + g_assert_cmpstr(str, ==, "3.140000"); g_free(str); } |