ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

edtcde

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • edtcde

    I need an output in my printer file as 0.00. I tried for 3, C, L ,P. they give
    only .00. Is there any other editcode for giving the output as 0.00


    Thanks
    Muthu
    Programmer
    Miles to Go, Before I sleep.

  • #2
    Re: edtcde

    You cant do this with an edit code because I think that all the codes suppress leading zeros.

    You will have to use an EditWord instead.

    example:

    A FIELD1 7 2 5 2EDTWRD(' 0. ')


    This will suppress leading zeros up to, but not including, the first digit to the left of the decimal place.

    The details on edit words can be found in the DDS reference
    You don't stop playing games because you get old, You get old because you stop playing games!

    Comment


    • #3
      Re: edtcde

      Hi

      It depends up how your SYSVAL QDECFMT is set.
      This value is valid for the system decimal editing.
      Try to figure with WRKSYSVAL SYSVAL(*EDT)

      Another way to avoid this is to define internal in your *pgm in H spec following keyword:
      DECEDIT('0,') or DECEDIT(',').

      The printout will be as follows = DECEDIT('0,') = 0,123
      DECEDIT(',') = ,123
      Last edited by Zdenko; December 1, 2005, 06:02 AM.
      LP Zdenko

      Comment


      • #4
        Re: edtcde

        Might also try editcode X

        eval char5 = %editc(dec52:'X')


        jamie
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment

        Working...
        X