[json-glib/json-glib-0-10] generator: Use %g format for g_ascii_formatd()
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [json-glib/json-glib-0-10] generator: Use %g format for g_ascii_formatd()
- Date: Fri, 19 Mar 2010 17:01:43 +0000 (UTC)
commit 6b2d50001f2db526c5108a764693a632573c51a0
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Thu Mar 18 17:05:57 2010 +0000
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.
(cherry picked from commit f622ee8d8ba54ddea6fbb7311a905ffab7842e8d)
Signed-off-by: Emmanuele Bassi <ebassi linux intel com>
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]