on 09-11-2007 5:53 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use the built in functions <b>ceil</b> and <b>floor</b>.
Regards,
Sesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.