Skip to Content
author's profile photo Former Member
Former Member

Round Off Function

Hi Experts,

I have form where for some value I need to print the Round Off Value. Ex: if the value is 55.90, it wil display 56 and if the value is 55.40 it will display 55. What Logic I can Use in SF coding. Plz help. Its urgent.

Tahanks.

Khan

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 05:04 AM

    Hi,

    logic has to be build this way

    parameters : price like vbap-netwr .

    data : val type i .

    data : rem type p decimals 2.

    rem = frac( price ).

    rem = rem * 100.

    if rem ge 50.

    val = abs( price ).

    move val to price.

    write price.

    else.

    write:/ price.

    endif.

    Reward points Please...

    Regards

    Murali Poli

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 11, 2007 at 04:59 AM

    Hi,

    You can use the built in functions <b>ceil</b> and <b>floor</b>.

    Regards,

    Sesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 05:05 AM

    check the following Functions

    following maths functionas are there in SAP:

    abs -Absolute value of the argument arg

    sign- Plus/minus sign of the argument arg: -1, if the value of arg is negative; 0 if the value of arg is 0; 1 if the value of arg is positive.

    ceil -Smallest integer number that is not smaller than the value of the argument arg.

    floor- Largest integer number that is not larger than the value of the argument arg.

    trunc- Value of the integer part of the argument arg

    frac- Value of the decimal places of the argument arg

    Reward points if useful

    Thanks

    Murali Poli

    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.