[Qt-interest] Hi guys, fprintf problem

Nikos Chantziaras realnc at arcor.de
Wed Apr 7 23:53:15 CEST 2010


On 04/08/2010 12:37 AM, Fabio Giovagnini wrote:
> 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?

http://www.acm.uiuc.edu/webmonkeys/book/c_guide/2.6.html



More information about the Qt-interest-old mailing list