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

How to round the packed integer value

Former Member
0 Likes
1,045

ex .data : a type p decimals 2.

if value of a = 10.22

then it should give a = 10.

if value of a = 10.52

then it should give a = 11.

if there is any predefine function then plz relpy

ex .data : a type p decimals 2.

if value of a = 10.22

then it should give a = 10.

if value of a = 10.52

then it should give a = 11.

if there is any predefine function then plz relpy

6 REPLIES 6
Read only

Former Member
0 Likes
1,006
Read only

Former Member
0 Likes
1,006

hi nilima,

just define like this your data type,

.data : a type p.

or use FM 'CO_R0_FLOAT_ROUND_RESULT' to give the round number .

reward points if helpful,

regards,

seshu.

Read only

Former Member
0 Likes
1,006

try this

data : a type p decimals 2,

b type i.

a = '10.22'.

b = abs( a ).

write : / b.

a = '10.52'.

b = abs( a ).

write : / b.

regards

shiba dutta

Read only

Former Member
0 Likes
1,006

Try this fm : CO_R0_FLOAT_ROUND_RESULT

Read only

Former Member
0 Likes
1,006

Hi

try using FLOOR

for more infor check the DEMO REPORT demo_data_function .

regards

Shiva

Read only

Former Member
0 Likes
1,006

hi,

using CEIL AND FLOOR functions u get desired o/p

as

ex .data : a type p decimals 2.

if value of a = 10.22.

CEIL a.

then it should give a = 10.

if value of a = 10.52,

FLOOR a.

then it should give a = 11.

if helpful reward some points.

with regards,

suresh.