View previous topic :: View next topic |
Author |
Message |
i413678 Beginner
Joined: 28 Jan 2005 Posts: 4 Topics: 3
|
Posted: Thu Dec 15, 2005 8:26 am Post subject: want to display the amount as ($5.00) |
|
|
Hi,
I want to display the amount like ($5.00)
my picture clause is $(6)9.9(2) and I inserted ( before and ) after this amount field and I am getting the value as ( $5.00) but I want to display as ($5.00).
means I dont want to display the spaces between left parenthesis and dollar symbol.
thanks in advance
pavan |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Dec 15, 2005 9:02 am Post subject: |
|
|
i413678,
Try this
Code: |
01 W-NUM.
05 W-VAL PIC $$$$$$9.99.
05 W-END PIC X.
MOVE 5.00 TO W-VAL
INSPECT W-VAL REPLACING ALL " $" BY "($"
MOVE ')' TO W-END
DISPLAY 'THE EDITED VALUE IS :' W-NUM
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Maximus Beginner
Joined: 17 Nov 2005 Posts: 21 Topics: 11
|
Posted: Tue Dec 20, 2005 1:21 am Post subject: |
|
|
Hi ,
We can also do in this way,
CODE:
01 W-NUM.
02 W-BEGIN PIC X VALUE '('.
02 W-VALUE PIC $$$$$$9.99.
02 W-END PIC X VALUE ')'.
MOVE 5.00 TO W-VALUE.
DISPLAY 'THE EDITED VALUE IS :' W-NUM |
|
Back to top |
|
 |
acevedo Beginner

Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Tue Dec 20, 2005 4:18 am Post subject: |
|
|
and you'll get
but not
|
|
Back to top |
|
 |
|
|