summaryrefslogtreecommitdiff
path: root/src/glade-property-class.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tvb@src.gnome.org>2006-08-22 19:11:06 +0000
committerTristan Van Berkom <tvb@src.gnome.org>2006-08-22 19:11:06 +0000
commit13178ce84619f4c89fa71a219718e51cfe9eae08 (patch)
tree6c47957a1ba0384e9e5cfeacb22661a1f316f103 /src/glade-property-class.c
parent03ae74e36be9ef954b58a04273e19c6eab0283d0 (diff)
downloadglade-13178ce84619f4c89fa71a219718e51cfe9eae08.tar.gz
use non locale specific functions to write out floats and doubles too
Diffstat (limited to 'src/glade-property-class.c')
-rw-r--r--src/glade-property-class.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/glade-property-class.c b/src/glade-property-class.c
index c6fcdb17..73671396 100644
--- a/src/glade-property-class.c
+++ b/src/glade-property-class.c
@@ -505,7 +505,7 @@ gchar *
glade_property_class_make_string_from_gvalue (GladePropertyClass *property_class,
const GValue *value)
{
- gchar *string = NULL, **strv;
+ gchar *string = NULL, **strv, str[FLOAT_BUFSIZ];
GObject *object;
GdkColor *color;
GList *objects, *accels;
@@ -571,9 +571,15 @@ glade_property_class_make_string_from_gvalue (GladePropertyClass *property_class
else if (G_IS_PARAM_SPEC_UINT64(property_class->pspec))
string = g_strdup_printf ("%llu", g_value_get_uint64 (value));
else if (G_IS_PARAM_SPEC_FLOAT(property_class->pspec))
- string = g_strdup_printf ("%f", g_value_get_float (value));
+ {
+ g_ascii_dtostr (str, FLOAT_BUFSIZ, g_value_get_float (value));
+ string = g_strdup (str);
+ }
else if (G_IS_PARAM_SPEC_DOUBLE(property_class->pspec))
- string = g_strdup_printf ("%g", g_value_get_double (value));
+ {
+ g_ascii_dtostr (str, FLOAT_BUFSIZ, g_value_get_double (value));
+ string = g_strdup (str);
+ }
else if (G_IS_PARAM_SPEC_STRING(property_class->pspec))
{
if (property_class->resource && g_value_get_string (value) != NULL)