‎2008 Jul 03 9:14 AM
Hi All,
I want a FM which will give me the nearest integer number.
E.g 2.3 will give 2.
REgards,
Jeetu
‎2008 Jul 03 9:18 AM
out type i.
val = 2.3.
out = CEIL( val ).
out = FLOOR( Val ).
write : out.
‎2008 Jul 03 9:15 AM
‎2008 Jul 03 9:16 AM
You don't need a FM. Use the ABAP statements CEIL and/or FLOOR.
Regards,
John.
‎2008 Jul 03 9:16 AM
‎2008 Jul 03 9:18 AM
out type i.
val = 2.3.
out = CEIL( val ).
out = FLOOR( Val ).
write : out.
‎2008 Jul 03 9:30 AM
CEIL and FLOOR is not helpful, the nearest integer to 2.8 will be 3, the nearest interger to 2.2 will be 2. If you have a varaible, which function do you wanna use?
Round is the correct answer, ceil and floor nonsense in this case.
‎2008 Jul 03 9:54 AM
Hi,
CEIL and FLOOR statements are used within fm ROUND
Best regards..
Edited by: pablo casamayor on Jul 3, 2008 10:54 AM