[Qt-interest] Hi guys, fprintf problem

Fabio Giovagnini fabio.giovagnini at aurion-tech.com
Wed Apr 7 23:37:28 CEST 2010


Hi all,
I know this is not the best place where to ask about fprintf function, but I 
do not know about glibc mailing list.
So sorry but let me ask.
I have Ubuntu 9.10 - Karmic Koala
in Italian language.
When I call 
fprintf(fd,"%.2f",floatval);
into the file I find 0,84 supposed that floatval is 0.84; the function use the 
Italian comma decimal separator instead of the universal dot separator I 
supposed.
This is for me a problem beacuse such these decimal values are into a comma 
separated file and with this notation my strtok based parser works wrongly.

How can I force fprintf to use dot decimal separator?
How caould to solve iun general this problem avoiding that fprintf detect teh 
LOCALE and customizes its behaviour correspondingly?

Thanks in advance and sorry again.

-- 
Fabio Giovagnini

Aurion s.r.l.
P.I e C.F.
00885711200
Tel. +39.051.594.78.24
Cell. +39.335.83.50.919



More information about the Qt-interest-old mailing list