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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Euro tip search (decimals display only)

Status
Not open for further replies.

pippolo

Technical User
Oct 21, 2002
1
IT
I'm looking for a tip that would solve my troubles with the euro software conversion: I would like to know how to display a value with the decimal point (ie. PIC ZZZ,ZZZ.Z9 for euros) while the program deals with it as an integer when I move it to the working field (if I do so the decimals are truncated).
 
Pippolo,

if you want to display an edited numeric field with 2 decimal positions, your sending field must have them too, something like PIC S9(6)V99.
If not, before moving, you'll have to work in those decimals by dividing by 100. Of course, the receiving field of that division must have a picture as described above; i'm not sure if you can have the result sent to the edited field straight away.

At my site, we use a standard PIC S9(17) PACKED-DECIMAL for all amounts; if needed, the decimal position is introduced depending on the currency involved.

Regards,
Ronald.
 
Hi,

01 INTEGER-FIELD PIC S9(18).
01 INTEGER-FIELD-V99 REDEFINES INTEGER-FIELD PIC S9(16)v99.
01 DISP-FIELD PIC Z,ZZZ,ZZZ,ZZZ,ZZZ,ZZ9.99.

Now you can work with the integer-field and at print- or display-time you move the integer-field-v99 to the disp-field because it is the same field in fact, only with an other position of the decimal-point.

I hope this is helpful.

Regards,

Crox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top