From f622ee8d8ba54ddea6fbb7311a905ffab7842e8d Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 18 Mar 2010 17:05:57 +0000 Subject: generator: Use %g format for g_ascii_formatd() I should read the documentation for the functions I use: Converts a gdouble to a string, using the '.' as decimal point. To format the number you pass in a printf()-style format string. Allowed conversion specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'. -- from g_ascii_formatd() in GLib's API reference Epic reading fail. --- json-glib/json-generator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'json-glib/json-generator.c') diff --git a/json-glib/json-generator.c b/json-glib/json-generator.c index bad239b..c77830e 100644 --- a/json-glib/json-generator.c +++ b/json-glib/json-generator.c @@ -309,7 +309,7 @@ dump_value (JsonGenerator *generator, { gchar buf[65]; - g_ascii_formatd (buf, 65, "%d", g_value_get_double (&value)); + g_ascii_formatd (buf, 65, "%g", g_value_get_double (&value)); g_string_append (buffer, buf); } break; -- cgit v1.2.1