View previous topic :: View next topic
|
Author |
Message |
brahmanandareddy
New User
Joined: 16 Dec 2004 Posts: 44 Location: Hyderabad
|
|
|
|
I have a variable of length PIC9(5).9(2).
I have given this number and I want to display the number as -124.35. How should I code the PIC clause? |
|
Back to top |
|
|
Ramya A
Active User
Joined: 26 Jul 2004 Posts: 104
|
|
|
|
You could move this value into a variable with PIC caluse -zzz99.99 |
|
Back to top |
|
|
brahmanandareddy
New User
Joined: 16 Dec 2004 Posts: 44 Location: Hyderabad
|
|
|
|
Hi Ramya,
Thanx for reply.
I think zzz is used for zero suppression. It suppresses zeroes to spaces. Am I right? If I am, then what is the correct solution?
Thank you,
Brahma |
|
Back to top |
|
|
Ramya A
Active User
Joined: 26 Jul 2004 Posts: 104
|
|
|
|
You are correct....zzz is used to suppress zeroes...
since your input value is 9(5).9(2), you may have a number -0012.45 which would be displayed as -12.45 if you move into the PIC clause that I specified.
Let me know if I'm wrong. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Sorry, Ramya, it doesn't work that way. If you use ----9.99 you'll get
-124.35.
It allows the sign to "float". You can do the same w/a $ sign. |
|
Back to top |
|
|
Ramya A
Active User
Joined: 26 Jul 2004 Posts: 104
|
|
|
|
oops....i got it!
Thanks for correcting me Jack... |
|
Back to top |
|
|
|