× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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.





As an Amazon Associate we earn from qualifying purchases.

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-2024 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].

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