‎2008 Nov 23 6:03 PM
Hi
I have a rounding error when I run the following code:
divider'235 'dividend and'3'. Then in the presence of odd numbers.
Could you give me a recommendation?
Thanks in advance,
‎2008 Nov 24 12:50 AM
hi,
if i undestand ur quistion correctly, if this is ABAP code plase remove flower brackets and use write command to print output..
‎2008 Nov 24 10:30 AM
Hi
report Z_div.
PARAMETERS: p_divi TYPE p ,
p_divid TYPE p DECIMALS 2.
data: f1_divi TYPE f .
DATA: f2_divid TYPE f .
data: value TYPE f.
move p_divi to f1_divi.
move p_divid to f2_divid.
data: value2 TYPE p DECIMALS 2.
value = f1_divi / f2_divid.
*valore = valore * 100 / 100.
value2 = value .
write value2.
Ty .
‎2008 Nov 24 10:41 AM
‎2008 Nov 24 1:18 PM
Hi
the result is correct but not rounded, for example writing 235 / 3, the result is 78.33 verify if the result I get 234.99 ... How can round off the result.
Thank you very much.
‎2008 Nov 24 2:08 PM
Hello
You get 234.99 because value2 was declared as TYPE p.
Declare this as integer.
‎2008 Nov 25 9:10 AM
Thank you very much!
I solved in another way, can I control between the past is the final result at the end add or subtract the aggregate.
The speech is a little more complicated than a simple division, we speak of Budget and Finance: D! Thanks again.
Massimo
‎2008 Nov 25 9:21 AM
Hi
It's not very clear what you need u should decided how to round off the result and how many decimals have to be used.
There are some particular fm to obtain it (for ex. FIMA_NUMERICAL_VALUE_ROUND)
Max
‎2008 Dec 01 10:06 AM
‎2008 Nov 24 1:25 PM
You can try ROUND
Write var to target_var round 0.
Regards,
Mohaiyuddin