From c4b2d3a144a148f8f9087f9d616b68a991440072 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 27 Apr 2011 17:10:34 -0400 Subject: [PATCH] gtkrc.c: Use g_ascii_dtostr for formatting floats We should be locale-independent. https://bugzilla.gnome.org/show_bug.cgi?id=647908 --- gtk/gtkrc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c index 6eefa342fb..82a6470e67 100644 --- a/gtk/gtkrc.c +++ b/gtk/gtkrc.c @@ -2520,7 +2520,14 @@ rc_parse_token_or_compound (GScanner *scanner, g_string_append_printf (gstring, " 0x%lx", scanner->value.v_int); break; case G_TOKEN_FLOAT: - g_string_append_printf (gstring, " %f", scanner->value.v_float); + { + gchar fbuf[G_ASCII_DTOSTR_BUF_SIZE]; + g_ascii_formatd (fbuf, + sizeof (fbuf), + "%f", + scanner->value.v_float); + g_string_append_printf (gstring, " %s", (char*)fbuf); + } break; case G_TOKEN_STRING: string = g_strescape (scanner->value.v_string, NULL);