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

Round off the decimal value

Former Member
0 Likes
4,285

hi,

I need decimal value round off to upper limit

input is 15.67 the output should be 16.

Regards,

deepthi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,242
DATA :
wa_test(10) TYPE p DECIMALS 2.
wa_test = '15.67'.
wa_test = CEIL( wa_test ).

DATA :
wa_test1(10) TYPE p DECIMALS 2.
wa_test1 = '15.67'.
wa_test1 = FLOOR( wa_test1 ).

WRITE: wa_test , wa_test1.

hi,

I need decimal value round off to upper limit

input is 15.67 the output should be 16.

Regards,

deepthi.

7 REPLIES 7
Read only

Former Member
0 Likes
1,242

Use FM

ROUND

Read only

0 Likes
1,242

hi,

the outp of FM round is

15.7 for input 15.68

my req is for input 15.68 , output is 16.

Regards,

Deepthi.

Read only

0 Likes
1,242

hi,

use these operators.

CEIL

Smallest integer value that is not less than x

FLOOR

Largest integer value that is not greater than x

Read only

Former Member
0 Likes
1,242

hii

Fm

ROUND

CO_R0_FLOAT_ROUND_RESULT

you can use following code

data : wa_val type p decimals 2,
           wa_ans type i.

           
         wa_val = '32.22'.
         wa_ans = abs( wa_val ).
         write : / wa_ans.
         wa_val = ceil ( wa_val ).
         write:/ wa_val.

regards

twinkal

Read only

Former Member
0 Likes
1,242

Round fm will do it

Read only

Former Member
0 Likes
1,243
DATA :
wa_test(10) TYPE p DECIMALS 2.
wa_test = '15.67'.
wa_test = CEIL( wa_test ).

DATA :
wa_test1(10) TYPE p DECIMALS 2.
wa_test1 = '15.67'.
wa_test1 = FLOOR( wa_test1 ).

WRITE: wa_test , wa_test1.
Read only

Former Member
0 Likes
1,242

Use this code

DATA pack TYPE p VALUE '15.67'.

WRITE pack NO-GROUPING DECIMALS 0.

This will help

Regards,

Prashant