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

Former Member
0 Likes
423

hi gurus,

is there any data type which rounds to the next integer.

ie.. a type i,

a = 23/11.

now the result stored in a = 2.

but i want the result to be rounded of to a = 3.

how can i acheive it.

thanks in advance,

chaitu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
405

Hi,

you can work with mod.

data: b type p decimals 2.

a = 23/11.

b = mod 23/11.

if b > 0.

add 1 to a.

endif.

Regards

Nicole

3 REPLIES 3
Read only

Former Member
0 Likes
406

Hi,

you can work with mod.

data: b type p decimals 2.

a = 23/11.

b = mod 23/11.

if b > 0.

add 1 to a.

endif.

Regards

Nicole

Read only

Former Member
0 Likes
405

Hi,

U can declare that variable as TYPE P (Packed number) which will round the number.

Try this.......

Read only

Former Member
0 Likes
405

s