View previous topic :: View next topic
|
Author |
Message |
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 463
|
|
|
|
Hi,
I am trying to display the signed value with integer but it is not giving me right value.
I defined the variable as
01 WS-VAR2 PIC S9(4)V99
Suppose i m moving value 113.24 but it showing me value as 01132D .
Could anybody tell me how to display correct value.
Thanks in advance
Rupesh.Kothari. |
|
Back to top |
|
|
kvivek
New User
Joined: 09 May 2005 Posts: 51 Location: Singapore
|
|
|
|
Quote: |
01 WS-VAR2 PIC S9(4)V99 |
Make it as
Code: |
01 WS-VAR2 PIC -9(4).99 |
Regards,
Vivek |
|
Back to top |
|
|
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 463
|
|
|
|
Hi Vivek,
Thanks a lot for quick response..
I m getting 50% what i want. When i tried below code i m getting 113.24 result but it is not showing me the sign. Is there any way to show the sign also.
Thanks
Rupesh. |
|
Back to top |
|
|
nitinmahajan
New User
Joined: 13 Jul 2005 Posts: 1
|
|
|
|
hi rupesh
ur declaration is correct just write there
Quote: |
sign leading seperate |
thats all
Rupesh.Kothari wrote: |
Hi,
I am trying to display the signed value with integer but it is not giving me right value.
I defined the variable as
01 WS-VAR2 PIC S9(4)V99
Suppose i m moving value 113.24 but it showing me value as 01132D .
Could anybody tell me how to display correct value.
Thanks in advance
Rupesh.Kothari. |
|
|
Back to top |
|
|
kvivek
New User
Joined: 09 May 2005 Posts: 51 Location: Singapore
|
|
|
|
Hi,
Quote: |
01 WS-VAR2 PIC -9(4).99 |
will display the negative sign only if the value is negative, If you want to display both positive and negative sign then use
Code: |
01 WS-VAR2 PIC +9(4).99 |
Regards,
Vivek |
|
Back to top |
|
|
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 463
|
|
|
|
HI,
thanks a lot for ur quick response.
It is working fine.
Thanks
Rupesh.Kothari |
|
Back to top |
|
|
|