The sprintf() API is locale sensitive so what you need to do is specify a locale that uses the period as a decimal point. One quick way to do that is to WRKENVVAR and change the job level environment variable LANG from whatever it currently is to "/QSYS.LIB/EN_US.LOCALE". Assuming you haven't modified this IBM supplied locale, running your program should now show the period being used for the formatting of doubles.

There are many, many other ways to specify a locale. This is simply one quick and easy way. Note that this change may also impact the running of several other C library functions that are locale sensitive.

Hope this helps,
Bruce
Bruce Vining Services

beppecosta <beppecosta@xxxxxxxxxxx> wrote:
I have a C program that prints a float with sprintf.

The decimal point is comma. How can I have the point
separator instead ?

I have tried to compile with TGTCCSID(37), to compile
from a job with CCSID(37) but it still prints with a
comma.

Thanks.





This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].