09-21-2008 7:50 AM
Hello every one,
I am working on pricing routine.
I am doing some arthematic calculations.
It is giving some odd reasults and i am unable to resolve it.
I guess it is problem with conversion and type miss match.
data : p1(16) decimals 5,
p2(16) decimals 5,
result type komv-kwert,
rate type komv-kbetr.
p1 = 70.00000.
p2 = 70.00000.
rate = 100.00.
result = rate * ( p1 / p2 ).
i am expecting result to be 100.00.
But result is not 100.00.
It is giving some odd figure.
can any one suggest me to resolve this issue.. and how to convert data types to overcome this problem.
Thanks in advance
ragards
Sunil
09-21-2008 8:30 AM
data : p1(16) type p decimals 5,
p2(16) type p decimals 5,
result type komv-kwert,
rate type komv-kbetr.
p1 = '70.00000'.
p2 = '70.00000'.
rate = '100.00'.
result = rate * ( p1 / p2 ).
write result.
i m getting 100.00 as output for the above code.
Check whether Fixed Point arithmetic checkbox is checked in the attributes of the program in se38 , if it is not checked you will get a diff value.
09-21-2008 8:30 AM
data : p1(16) type p decimals 5,
p2(16) type p decimals 5,
result type komv-kwert,
rate type komv-kbetr.
p1 = '70.00000'.
p2 = '70.00000'.
rate = '100.00'.
result = rate * ( p1 / p2 ).
write result.
i m getting 100.00 as output for the above code.
Check whether Fixed Point arithmetic checkbox is checked in the attributes of the program in se38 , if it is not checked you will get a diff value.