Application Development and Automation 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: 
Read only

Simple problem

kesavadas_thekkillath
Active Contributor
0 Likes
650

I have faced a small problem...but its irritating......

DATA:a type p decmals 2 value '8.75'.

DATA:b type p decmals 2 value '8.75'.

data:c type p decimals 2.

c = a / b.

here c must contain 1.

but for me its storing as 0.01.

what may be the problem.....Anybody faced this kind of issue...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
630

goto program attributes

check the box "fixed point arithmetic"

save & activate

I have faced a small problem...but its irritating......

DATA:a type p decmals 2 value '8.75'.

DATA:b type p decmals 2 value '8.75'.

data:c type p decimals 2.

c = a / b.

here c must contain 1.

but for me its storing as 0.01.

what may be the problem.....Anybody faced this kind of issue...

4 REPLIES 4
Read only

Former Member
0 Likes
631

goto program attributes

check the box "fixed point arithmetic"

save & activate

Read only

Former Member
0 Likes
630

Hi friend,

Please remove that decimal for the data type c.

u r declaring decimal as 2.

so that it showing 0.01

Please reward points if is useful to u.

Regards,

satish

Read only

Former Member
0 Likes
630

Hi

u have declared c as type p decimals 2 so ur output is getting two zero places.

if u type c as type p. the output will be 1.

data: c type p.

Thanks&Regards,

S.Gangi reddy.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
630

Thanks a lot ramu