|
If tou need the output aligned by the decimal point you can put the edited field in a work area and replace the trailing zeros by blanks, something like this:
asuming an edited output of 20 characters, adjust as needed. aux20 = %editc(number:.. for i = 20 to 1 by -1; if %subst(aux20: i: 1) <> *zero; leave; endif; %subst(aux20: i: 1) = *blank; endfor; If you don't care about align: edited= %xlate(' ': '0': %trim(%xlate('0': ' ': %editc(number: 'a'))); ________________________________________________________________________________ Dwarakanath, Srikanth (Cognizant) wrote:
Thanks Jim, Resending my request..... I have a requirement not to print trailing zeros in decimal fields. I had a look at all the %EDIT options in RPG's built in function, could not figure it out by my self. For e.g. 123.5600000 should be printed as 123.56. Can I get some help please. Many thanks for help. Best rgds., Srikanth D
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.