Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Need Help on CEIL command

$
0
0

Hello Everyone

 

May I get you help on CEIL command?

I wrote the following test program:

---------->

REPORT  ZTEST_TOM_CALCT.

data:
result type I,
p1 type P DECIMALS 2,
p2 type P DECIMALS 2,
p3 type P DECIMALS 4,
p4 type P DECIMALS 4.


p1 = '5349.00'.
p2  = '0.25'.
p3  = '123.0000'.
p4  = '123.0000'.

result = CEIL( P1 * p2 / p3 * p4 * 100 ).
write result.

data: p_temp type string.
p_temp = P1 * p2 / p3 * p4 * 100 .
write:/ p_temp.

data:c_temp type p.
c_temp = ceil( p_temp ).
write:/ c_temp.

<-------------

 

The result is:

   133,726

133725.00000000000000

        133,725

 

I can understand ceil ( 133725.00..) = 133725.

But why

result = CEIL( P1 * p2 / p3 * p4 * 100 ) = 133726 ?

 

Regards

Tom


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>