|
Edit code 3 and %CHAR are similar but not identical. EVAL myVal = %Char(numVal) Vs. Eval myVal = %TrimL(%EDITC(numVal : '3')) Will produce a different result when the NUMVAL field contains a negative value. Edit code 3 does not who the negative sign. I assume that the context of this field being used calls for it to NOT have a sign, or rather the value never goes negative, so the subtle difference is probably moot. If there is a possibility that NUMVAL may be negative and you want the sign to appear, you really don't want to be using edit code 3. In fact, in this situation, %Char(NumVal) will give you better results. Conclusion.... You probably want to use eval myVal = %char(numVal) unless you specifically do NOT want the negative sign to appear in the result. -Bob Cozzi www.RPGxTools.com RPG xTools - Enjoy programming again. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Fisher, Don Sent: Thursday, October 13, 2005 8:32 AM To: 'RPG programming on the AS400 / iSeries' Subject: RE: MOVEL in Freeformat & DDS You would have to define the field as character in the DDS and then use EVAL DisplayField = %TRIM(%EDITC(NumericField:'3')) to display the number left justified without leading zeroes. Hope that helps. Donald R. Fisher, III Project Manager Roomstore Furniture Company (804) 784-7600 extension 2124 DFisher@xxxxxxxxxxxxx <clip> I have a numeric field that has an EDTCDE(3) on it in the DDS to strip off leading zeros. However, when I display the field it right-justifies the number. <clip>
As an Amazon Associate we earn from qualifying purchases.
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.