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 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


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2021 by 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.