diff options
author | Emmanuele Bassi <ebassi@linux.intel.com> | 2010-03-18 17:05:57 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@linux.intel.com> | 2010-03-18 17:11:48 +0000 |
commit | f622ee8d8ba54ddea6fbb7311a905ffab7842e8d (patch) | |
tree | b1f4d40307804bfada0df23124f901cae1f44b9d /json-glib/json-generator.c | |
parent | 90d6e0b8c334b3fd7995c126f07dd61ba0a9e0fb (diff) | |
download | json-glib-f622ee8d8ba54ddea6fbb7311a905ffab7842e8d.tar.gz |
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.
Diffstat (limited to 'json-glib/json-generator.c')
-rw-r--r-- | json-glib/json-generator.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |