2009 Mar 04 12:55 AM
Hi ,
How to write a logic for the following scenario.
For ex : value = 55.95 or 56.01 need to 56 like that..it may be 89.95 etc
set this to the closest number
e.g. if it is between 55.85 to 55.99 make it 56.
Or if it is between 55.1 to 55.15 make it 55.
Please let me know how to write it.
Thanks in Advance
R
2009 Mar 04 1:14 AM
Try to use fm
CALL FUNCTION 'ROUND'
EXPORTING
decimals = 2
input = v_num
sign = '+'
IMPORTING
output = v_out.
a®
2009 Mar 04 1:14 AM
Try to use fm
CALL FUNCTION 'ROUND'
EXPORTING
decimals = 2
input = v_num
sign = '+'
IMPORTING
output = v_out.
a®
2009 Mar 04 2:38 AM
2009 Mar 04 2:45 AM
2009 Mar 04 3:10 AM
try to move the value to Type N ( if you donnot have a decimal)... and type i (with decimals) or Round FM is better ..
2009 Mar 04 4:07 AM
Hi,
If you make the data type as 'i' then it will give you the round of value of the variable,moreover above mentioned function module will also result in the same thing.
Pooja