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

Type P divide type p

Former Member
0 Likes
886

Dear All expert,

I meet a problem.I need divide 60798.12345 by 1234.12385.Then I always got 0.00000000002 in the tartget field.

Do you have any suggestions about it ?

Many thanks in advance/

1 ACCEPTED SOLUTION
Read only

former_member188827
Active Contributor
0 Likes
794

go to program attributes and check if "FIxed point Arithmetic" is checked or not..if not check the check box

Dear All expert,

I meet a problem.I need divide 60798.12345 by 1234.12385.Then I always got 0.00000000002 in the tartget field.

Do you have any suggestions about it ?

Many thanks in advance/

4 REPLIES 4
Read only

Former Member
0 Likes
794

Can't replicate the problem...

data: p1 type p decimals 5,
      p2 type p decimals 5,
      p3 type p decimals 5.

start-of-selection.
p1 = '60798.12345'.
p2 = '1234.12385'.
p3 = p1 / p2.
write p3.

49.26420

Read only

Former Member
0 Likes
794

Hi,

Dont use DIV instead use /.

I used DIV i didnt get the proper result.Now i have pasted the code which worked for me.

>data: a type p decimals 5 value '1234.12385',

> b type p decimals 5 value '60798.12345',

> c type p decimals 5.

>

>

> c = b / a.

>

> write: C.

Regards,

Shanmugavel chandrasekaran

Read only

former_member188827
Active Contributor
0 Likes
795

go to program attributes and check if "FIxed point Arithmetic" is checked or not..if not check the check box

Read only

Former Member
0 Likes
794

Hi Joshua,

In SE38 Enter your program name and select ATTRIBUTES radio button. Check the Fixed Point arthimatic Check box.

You issue gets resolved.

REPORT  ZTEST_NEW.
data : var1 type p DECIMALS 5 value '60798.12345',
      var2  TYPE p DECIMALS 5 VALUE'1234.12385',
      var3 TYPE p DECIMALS 5.
" If the Check box is not selected then the result is ,00049
var3 = var1 / var2. " This is a Checkd Code snippet
write var3. " and its value is  49.26420

Cheerz

Ram