Application Development 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: 

Round up

Former Member
0 Kudos
101

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

Former Member
0 Kudos
64

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

Former Member
0 Kudos
64

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

former_member191977
Contributor
0 Kudos
64

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

Former Member
0 Kudos
64

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

Former Member
0 Kudos
65

u can use the following commands

CEIL <variablename>

FLOOR <variablename>

CEIL <12.4> Output is 13

FLOOR <12.4> Output is 12

Former Member
0 Kudos
64

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

0 Kudos
64

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

0 Kudos
64

Hi

pls can u give suggestion for above question

i am also facing same problem