Announcement

Collapse
No announcement yet.

minus sign in a packed field

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

  • CRinger400
    replied
    I would expect -000000000000014.43 to have packed character value of '0000000000000014.4L' not '0000000000000014.4P'.
    Letters J to S represent -1 to -9 (hex D1 to D9) and } for -0 (hex D0).

    Ringer

    Leave a comment:


  • TedHolt
    replied
    What about something like this?

    Code:
    dcl-s  A18a    char(20);
    dcl-s  Min1IP  packed(18:2);
    
    Min1IP = -14.43;
    
    A18a = %editw(Min1IP: '0                .  ');
    
    if Min1IP >= *zero;
       %subst(A18a:1:1) = *zero;
    else;
       %subst(A18a:1:1) = '-';
    endif;

    Leave a comment:


  • Scott Klement
    replied
    This is a weird format you're looking to produce. this is not a normal format that I've seen people use. Since what you're looking for is rather uncommon, you may have to write a (very simple) routine to do the formatting for you rather than using a simple %EDITC.

    Leave a comment:


  • dcutaia
    replied
    with this code :
    A18a=%Trim(%EDITC(MIN1IP:'X')); //INV PAYMENT /5
    I am getting:
    0000000000000014.4P
    if I need it -000000000000014.43
    should I try this %EDITC
    A18a=%Trim(%EDITC(MIN1IP:'N')); //INV PAYMENT /5

    Leave a comment:


  • dcutaia
    started a topic minus sign in a packed field

    minus sign in a packed field

    Does anyone know how I can send a negative sign(minus) sign to a packed field that is 18.2.
    For example instead of 0000000000000014.4P
    I want -000000000000014.43

    Thanks
    DAC
Working...
X