Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Zeroes in text file

former_member184551
Contributor
0 Kudos

Hi guys my problem is,

I have a struct which has the foll component of type c(7).

z_rate(7) type c.

I need to download this to a text file in a way that it shows just two decimal places but doesn not condense the rest of the space.

eg

11.00 nextvalNEXTVAL.....and so forth

at the moment the txt file appears like this

11.0000nextvalNEXTVAL.....and so forth

I am passing value to z_rate like this

data:source(4) type p dec 4.

buffer(4) type p dec 2.

buffer = source.

z_rate = buffer.

append struct.

Please advise.

Points assured

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

It looks ok.. May be you are not clearing the existing contents of the Z_RATE.

data:source(4) type p dec 4.
buffer(4) type p dec 2.

clear z_rate.
buffer = source.
z_rate = buffer.
append struct.

Regards,

Naimesh Patel

3 REPLIES 3

Former Member
0 Kudos

Sameer,

data:source(4) type p dec 2."instead of data:source(4) type p dec 4.

Regards

Aneesh.

naimesh_patel
Active Contributor
0 Kudos

It looks ok.. May be you are not clearing the existing contents of the Z_RATE.

data:source(4) type p dec 4.
buffer(4) type p dec 2.

clear z_rate.
buffer = source.
z_rate = buffer.
append struct.

Regards,

Naimesh Patel

0 Kudos

u were abolutly right my friend !

mayb iam nt getting enuf sleep

rgds

Sameer