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

data type

dhananjays_naphade
Active Participant
0 Likes
501

Hi,

I want result 3/2 = 1.5. Please which data types to be used because i tried with type P decimals 2 but result is 1.00. I have defined three data objects and their type is P decimals 2 and using value to hard code constant ie 2 & 3. when i use operator div and divide 3 by 2 i am geting value 1.00. Please gudie

Thanks

Moderator message: please use more descriptive subject lines from now on.

Edited by: Thomas Zloch on Jun 7, 2010 5:10 PM

1 ACCEPTED SOLUTION
Read only

ThomasZloch
Active Contributor
0 Likes
441

You do know that the DIV operator is for integer calculations only? You can find the correct operator yourself.

Thomas

2 REPLIES 2
Read only

ThomasZloch
Active Contributor
0 Likes
442

You do know that the DIV operator is for integer calculations only? You can find the correct operator yourself.

Thomas

Read only

Former Member
0 Likes
441

check this code

data num type p DECIMALS 2 value '3.00'.

data den type i value 2.

data res type p decimals 2.

res = num / den.

write res.

Thanks

Bala Duvvuri