07-20-2005 9:34 PM
hi folks,
how do you prefix the negative sign to the number.
I have the number stored in 'zpayment' and I have to add the negative sign to the before the number.
thanks
Santhosh
07-20-2005 10:00 PM
You could:
CONCATENATE '-' zpayment INTO zpayment.
CONDENSE zpayment NO-GAPS.
SHIFT zpayment RIGHT DELETING TRAILING space.
On the other hand, you could do the calculation before moving the amount to zpayment.
Rob
07-20-2005 9:59 PM
Hi,
Move the fields to a char type variable and then concatenate - sign before it.
Look at the code :
data : a type i,
b(10) type c.
a = 1 - 100.
b = a.
if a < 0.
concatenate '-' b into b .
condense b no-gaps.
endif.
write : b RIGHT-JUSTIFIED.
regards,
Gagan
07-20-2005 10:00 PM
You could:
CONCATENATE '-' zpayment INTO zpayment.
CONDENSE zpayment NO-GAPS.
SHIFT zpayment RIGHT DELETING TRAILING space.
On the other hand, you could do the calculation before moving the amount to zpayment.
Rob