Former Member

# Round up factor

Hi all,

here is what I'm looking for: On my selection screen I have a parameter of a round-up factor. With this factor I need to round a quantity. If for example I have a quantity of 2.26 and my factor is 25% it should go to 2.5.

Can anyone help how to do this?

Thanx!

##### Add a comment
10|10000 characters needed characters exceeded

### Related questions

Former Member
Posted on May 31, 2007 at 04:31 PM

what exactly do u men by 25% as round faactor.....can explain indetail

##### Add a comment
10|10000 characters needed characters exceeded
• Former Member Former Member

take an integer type and move the original value into a dummy variable say dummy of the original variable type.

data a, b type i.

dummy = 2.26

b = dummy - 0.5. " b = 2

a = ( dummy - b ) * 100. " a = 26

now u have write if else block to see whether 'A' is in between 0-25, 25-50, 50-75, 75-100.

if a bt 0 and 25.

a = 25.

elseif a bt 25 and 50.

a = 50.

...

....

endif.

dummy = b + ( a / 100 ).

copy back dummy to its original value.

• Former Member
Posted on May 31, 2007 at 04:38 PM

<deleted>

Message was edited by:

Chandrasekhar Jagarlamudi

##### Add a comment
10|10000 characters needed characters exceeded
• Former Member
Posted on Jun 18, 2008 at 04:23 AM
```qty    = '2.55'.
tmp    = qty mod 1.
qty    =  qty DIV 1.

if tmp > '0.50'
qty    = qty+1.
endif.
```

Edited by: Priyanka Chowdry on Jun 18, 2008 6:23 AM

##### Add a comment
10|10000 characters needed characters exceeded