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

decimal rounding off problem

Former Member
0 Likes
466

hi all,

i am having an structure, whoes one field is of decimal type with 2 as the decimal place, after the calculation the value in the field is like F1 = 333.34,

but i want the field should contain the value as F1 = 333.366666666

but it is rounding the decimal values,

and if i change the decimal place form 2 to some higher value like 4 or 5 then program gives a short dump,

can some please suggest the solution for this problem,

thanks in advance,

2 REPLIES 2
Read only

Former Member
0 Likes
410

Hi,

Declare the variable in this way.

data: t(16) type p decimals 9

Packed decimal can limit a size of 16 only.

Regards,

Subha.

Read only

Former Member
0 Likes
410

Hi Sudeep,

declare ur data

data: F11(20) type p decimals 9.

change the field length according to ur requirement. then store the value in that variable.

Regards

Srimanta