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

Round FM and keyword issue

$
0
0

Hi,

 

     I have a result that needs rounding.

     The result on two different occassions are 0.1147 and 22.7919 (Input)

     After rounding, the expected values are 0.12 and 22.79 (Output)

 

     I tried, Round keyword as follows:

 

         output =  round( val = input dec = 2 mode = 1 )

 

     It generates the below outputs 

          When input = 0.1147, output is 0.12 and (as expected)

          When input = 22.7919, output is 22.8      (not expected)

 

     I tried the ROUND FM as follows:

 

     CALL FUNCTION 'ROUND'
            EXPORTING
                  DECIMALS    = 2
                  INPUT            = input
                  SIGN              = 'X'
           IMPORTING
                  OUTPUT         = output

 

     It generates the below outputs:

          When input = 0.1147, output is 0.11 and (not expected)

          When input = 22.7919, output is 22.79    (not expected)

 

     Can anyone please suggest a way to get the expected outputs (0.12, 22.79)

 

Regards.


Viewing all articles
Browse latest Browse all 8332

Trending Articles



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