Re: gtk doesn't like fprintf )o;



Hi, you need something like this in your main():

        gtk_set_locale();
        setlocale( LC_NUMERIC, "C" );
        gtk_init( argc, argv );

This will set your locale to French (so menus etc. will be in French),
but set the numeric locale (which handles number formats) to "C" (ie.
C-language style).

An even better alternative is to use these functions:

http://developer.gnome.org/doc/API/2.0/glib/glib-String-Utility-Functions.html#g-ascii-strtod
http://developer.gnome.org/doc/API/2.0/glib/glib-String-Utility-Functions.html#g-ascii-dtostr

they convert numbers to strings and back, but always use '.' for decimal point.

On Fri, 17 Dec 2004 11:20:42 +0100 (CET), sinsedrix voila fr
<sinsedrix voila fr> wrote:
> 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.



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