Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DECIMAL POINTS 1

Status
Not open for further replies.

Decimal

Programmer
Aug 13, 2001
1
0
0
US
No matter wat methods i try .. i can't seem to get decimal points on my output file. is there anything wrong with using 9(3)V99 ???
 
Hi,
Your picture of 9(3)v99 means to use an implied decimal point. If you want an actual decimal point you will need to use an edit picture of 9(3).99
 
Hi Dec,

Adding to what MR said, you can use zzz.99 to replace the leading zeros w/spaces, e.g. 00321 will print as 3.21; 00000 will print as .00.

You can use a "floating" $ sign, e.g. $$$.99; 00321 will print as $3.21; 00000 as $.00.

You can use a "floating" - sign, e.g. ---.99; 00321 will print as 3.21; 00000 as .00; 0032A will print as -3.21.

There are others, but I must rest. :)

Good luck, Jack.
 
Hello again Dec,

I was in error trying to explain the "floating sign".
It should read as follows:

You can use a "floating" - sign, e.g. ---.99; 00321 will print as 3.21; 00000 as .00; and 0032J (X'F0F0F3F3D1') will print as -3.21. Remember, your sending field must have a sign in its pic (S999v99), else all prints of negative #s will show as positive.

Jack

 
In simpler terms, you use an implied decimal place in an input file (or other file you read from) I.E

If the data for a field is supposed to be 18.99 if you didn't put the assumed decimial place it would read it as 1899.

However when you are going to be displaying the decimal point (on a printout for example) you use the actual decimal point, using the V in OUTPUT will ever give you an error or not display anything (on one compiler it gave me an error and on another it didn't do anything), likewise using the . (actual decimal) in INPUT will give you an error.

Chris Green
Computer Information Systems Student
Cayuga Community College -- Fulton
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top