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

Rounding a number

Former Member
0 Likes
621

Hi

How to round a Number to the next integer.

Like say

data : v_num type p decimals 2 .

v_num = 0.45

output = 1

v_num = 4.26

output = 5

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
597

try

ceil

int a = 0.7.

int b.

b = ceil( a ).

Regards,

ravi kanth

Hi

How to round a Number to the next integer.

Like say

data : v_num type p decimals 2 .

v_num = 0.45

output = 1

v_num = 4.26

output = 5

4 REPLIES 4
Read only

Former Member
0 Likes
597

Hi,

Use FM ROUND.

Check this post also

Regards,

Satish

Read only

Former Member
0 Likes
598

try

ceil

int a = 0.7.

int b.

b = ceil( a ).

Regards,

ravi kanth

Read only

0 Likes
597

Thank you Ravi

Read only

Former Member
0 Likes
597

Try this

DATA: INT TYPE I, 
DEC TYPE P DECIMALS 2, 
DEC = '3.45'.
INT = CEIL( DEC ). " 4 - next largest whole number 
WRITE INT.

Regards,

Satish