X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Frecode-dialog.c;h=4ef8ae216d88f3a9825bf3555a5b0d81cbc36221;hb=14f4522a17db23e67a6fa17876633cc6260cb42b;hp=f8d21336e131bc4d46bc832eef937c11f28e69dc;hpb=5f91f0868ec7cdbdb7900a2cb6e876b467fb2a6e;p=pspp diff --git a/src/ui/gui/recode-dialog.c b/src/ui/gui/recode-dialog.c index f8d21336e1..4ef8ae216d 100644 --- a/src/ui/gui/recode-dialog.c +++ b/src/ui/gui/recode-dialog.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2007, 2009, 2010, 2011, 2012 Free Software Foundation + Copyright (C) 2007, 2009, 2010, 2011, 2012, 2014 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +30,7 @@ #include +#include #include #include #include @@ -104,7 +105,7 @@ new_value_to_string (const GValue *src, GValue *dest) { case NV_NUMERIC: { - gchar *text = g_strdup_printf ("%g", nv->v.v); + gchar *text = g_strdup_printf ("%.*g", DBL_DIG + 1, nv->v.v); g_value_set_string (dest, text); g_free (text); } @@ -314,7 +315,7 @@ recode_different_dialog (PsppireDataWindow *de) static gchar * num_to_string (gdouble x) { - return g_strdup_printf ("%g", x); + return g_strdup_printf ("%.*g", DBL_DIG + 1, x); } /* Callback which gets called when a new row is selected @@ -956,7 +957,7 @@ new_value_append_syntax (struct string *dds, const struct new_value *nv) switch (nv->type) { case NV_NUMERIC: - ds_put_c_format (dds, "%g", nv->v.v); + ds_put_c_format (dds, "%.*g", DBL_DIG + 1, nv->v.v); break; case NV_STRING: syntax_gen_string (dds, ss_cstr (nv->v.s));