/* json-generator.c - JSON streams generator
- *
+ *
* This file is part of JSON-GLib
* Copyright (C) 2007 OpenedHand Ltd.
* Copyright (C) 2009 Intel Corp.
#include "json-types-private.h"
-#include "json-marshal.h"
#include "json-generator.h"
struct _JsonGeneratorPrivate
g_string_append (buffer,
g_ascii_dtostr (buf, sizeof (buf),
json_value_get_double (value)));
+ /* ensure doubles don't become ints */
+ if (g_strstr_len (buf, G_ASCII_DTOSTR_BUF_SIZE, ".") == NULL)
+ {
+ g_string_append (buffer, ".0");
+ }
}
break;