When I print a decimal number by using edtcde 1-4 in a
RPG program, all numbers that are less then 1, are displayed
without leading zero. For example: I specify in the output
form edtcde(1) for a certain decimal variable. If it euals
to 1.5 "1.5" is printed, but if it equals to 0.5 ".5" is
printed.
I've tried all the edit codes 1-4 and j-m. All of them
yield the same result. Is there any way to display the leading
zero when the number is a fraction?
Thank you for your answers. Even an appropriate reference
is good enough.
Amos
You could try editmasks IIRC " 00.00" or maybe " ##.##" The mask is
a bit stupid as the 1st (leftmost) # or 0 is the place where the last
digit will be changed from zero to blank as opposed to the 1st
character where a leading zero is allowed.
If you need editcodes then there are userdefinable ones which I may
have tried in the past & will require you to write & register a
program to do the editing for oyu.
HTH
Jonathan
I do not recall if\what edit codes enable a /leading zero/ to be
included in that case, but the EDTWRD() of DDS [which I believe has an
equivalent in RPG as %edtwrd()] can enable forcing a leading zero using
a /stop zero suppress/ character. To get a P(3,1) numeric to appear as
described, with one leading zero for a value smaller than the absolute
value of one, then the following Edit Word definition suffices:
EDTWRD('0 . ')
For a value of 1.5 or -1.5, the value ' 1.5' will be the result of
the function. For a value of .5 or -0.5, the value of ' 0.5' will be
the result of the function.
In the help text of Query/400, having navigated to the /Edit Code/
screen via the F16=Define Numeric Editing from the Report Column
Formatting screen, there is a good table describing the edit code
capabilities.
Regards, Chuck
%editc(YourVar:'X') - 'X' will keep ALL leading zeros - Particularly
useful for shoving a numeric into a character field and keeping all
numeric positions....this editc evaluates out as a character....
Thank you all,
I'll try in my program and if the are still questions. I'll submit
a message again
Ace
"AMOS" <am1...@walla.com> schreef in bericht
news:d1b87f1a-1496-4842...@j8g2000yql.googlegroups.com...