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

10|10000 characters needed characters exceeded

### Related questions

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.

Regards

Murali Poli

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

10|10000 characters needed characters exceeded
• 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