gtkrc.c: Use g_ascii_dtostr for formatting floats

We should be locale-independent.

https://bugzilla.gnome.org/show_bug.cgi?id=647908
This commit is contained in:
Colin Walters 2011-04-27 17:10:34 -04:00
parent 19c145570a
commit c4b2d3a144

View File

@ -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);