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 up

Former Member
0 Likes
885

Hi all,

here is my request, i need to rund up to the highest value depending on the round up factor entered by user. For exemple he enters 0.5 as factor. What I need to do is for exemple my result that needs to be rounded is 12.35 then the result should be 12.50. Can anyone help on how to do this??

Thanx!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
848

u can use the following commands

CEIL <variablename>

FLOOR <variablename>

CEIL <12.4> Output is 13

FLOOR <12.4> Output is 12

7 REPLIES 7
Read only

Former Member
0 Likes
848

did u check the function module <b>ROUND</b>?

Read only

Former Member
0 Likes
848

Check the FM Round documentation if it is of any help to you.

Read only

Former Member
0 Likes
848

Hi,

Here is the example Program

DATA pack TYPE p VALUE '123.456'
                        DECIMALS 3.

WRITE pack DECIMALS 2.

WRITE: / pack ROUND -2,
       / pack ROUND -1,
       / pack ROUND 1,
       / pack ROUND 2.

Result is 
  123,46

12.345,600
1.234,560
    12,346
     1,235

You need to use like

<b>WRITE: / pack ROUND Your_field.</b>

Regards

Sudheer

Read only

Former Member
0 Likes
849

u can use the following commands

CEIL <variablename>

FLOOR <variablename>

CEIL <12.4> Output is 13

FLOOR <12.4> Output is 12

Read only

Former Member
0 Likes
848

u have solved ur problem and for curtosy sake just specififed 2 oints and close the thread.....

Read only

0 Likes
848

I have found the answer by myself...thanx to all!!

Read only

0 Likes
848

Hi

pls can u give suggestion for above question

i am also facing same problem