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



%char isn't causing the issue. You are doing integer division which returns an integer - that step loses the decimal places. %char just converted that integer to character.

Scott Mildenberger | Software Developer | Washington Companies IT Services | 101 International Drive | Missoula, MT | Office: 406-523-1536 | www.washingtoncompanies.com

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of dlclark@xxxxxxxxxxxxxxxx
Sent: Tuesday, March 03, 2020 8:31 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: Decimal Place in Character String

return %char(packed_data / d_shift);


Let me be more clear... "packed_data" had no decimal places. The
purpose of d_shift was to put 2 decimal places into the number and then
return it as a character string. I decided that %CHAR took no account of
the division operation and simply produced output with no decimal place
because neither of the variables in the expression had decimal places.


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.