From: Andrea Zagli Date: Sat, 11 Dec 2010 08:35:08 +0000 (+0100) Subject: Bugfix on setting locale in GtkFormFieldFloat. X-Git-Tag: 0.1.5~2 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=152243e827c793f5835572d112ef15156ad37610;p=libgtkform Bugfix on setting locale in GtkFormFieldFloat. --- diff --git a/src/fieldfloat.c b/src/fieldfloat.c index 59cfb5b..26941bd 100644 --- a/src/fieldfloat.c +++ b/src/fieldfloat.c @@ -187,13 +187,13 @@ gchar if (value != NULL) { - char *cur = setlocale (LC_NUMERIC, NULL); + char *cur = g_strdup (setlocale (LC_NUMERIC, NULL)); gfloat fval = strtod (value, NULL); - + setlocale (LC_NUMERIC, "C"); ret = g_strdup_printf ("%f", fval); - + setlocale (LC_NUMERIC, cur); g_free (value); @@ -373,7 +373,7 @@ gtk_form_field_float_set_from_hashtable (GtkFormField *field, GHashTable *hashta priv->original_value = 0.0; setlocale (LC_NUMERIC, ""); - ret = gtk_form_field_float_set_value_stringify (field, "0.0"); + ret = gtk_form_field_float_set_value_stringify (field, "0.0"); } else {