Re: gtk doesn't like fprintf )o;



sinsedrix voila fr wrote:

Snif,
It seems that when i use some fprintf in a gtk program,
a bug comes, floating point numbers are written in french :
"90,0000" instead of "90.0000" , it's annoying because
my program generates postscript and ghostview doesn't
like this writing.

I specify that I'm french and something on my system must
be responsible for that bug, but what ?
I've already tried to remove the gtk_set_locale() but it doesn't
seem to change anything.
This is because of your locale, French decimal point is ',' symbol. You can use gtk_disable_setlocale() function before gtk_init() call, but this is a weird solution.

How about to use g_ascii_formatd() function ? It will convert a double to the string with '.' decimal point.
http://developer.gnome.org/doc/API/2.0/glib/glib-String-Utility-Functions.html#g-ascii-formatd

   Olexiy




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]