From: Robert Kessl Date: Mon, 21 Jul 2014 12:49:46 +0000 (+0200) Subject: xtypes: update of default formatting X-Git-Tag: v6.1~3^2~73 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=da60e64858ca96bc150c04e88cad94766e7cdfdf;p=libucw.git xtypes: update of default formatting --- diff --git a/ucw/xtypes-basic.c b/ucw/xtypes-basic.c index 2d365078..9bca1436 100644 --- a/ucw/xtypes-basic.c +++ b/ucw/xtypes-basic.c @@ -55,12 +55,12 @@ static const char *xt_double_format(void *src, u32 fmt, struct mempool *pool) switch(fmt) { case XTYPE_FMT_RAW: - return mp_printf(pool, "%.10lf", *(double *)src); + return mp_printf(pool, "%.15lg", *(double *)src); case XTYPE_FMT_PRETTY: return mp_printf(pool, "%.2lf", *(double *)src); case XTYPE_FMT_DEFAULT: default: - return mp_printf(pool, "%.5lf", *(double *)src); + return mp_printf(pool, "%.6lg", *(double *)src); } } @@ -84,9 +84,9 @@ XTYPE_NUM_STRUCT(double, double) static const char *xt_bool_format(void *src, u32 fmt UNUSED, struct mempool *pool) { switch(fmt) { - case XTYPE_FMT_DEFAULT: case XTYPE_FMT_PRETTY: return mp_printf(pool, "%s", *((bool *)src) ? "true" : "false"); + case XTYPE_FMT_DEFAULT: case XTYPE_FMT_RAW: return mp_printf(pool, "%s", *((bool *)src) ? "1" : "0"); default: