Skip to Content
author's profile photo Former Member
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

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    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.

  • author's profile photo Former Member
    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

  • author's profile photo Former Member
    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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.