Quantcast
Channel: SCN : Discussion List - SAP Business Warehouse
Viewing all articles
Browse latest Browse all 6437

Truncating all right decimal values to get 2 decimal number

$
0
0

Hi Folks ,

 

I have a requirement where data comes as below and i need to truncate the decimals values to get only 2 decimal number.

 

For eg.

 

45.258748545 = 45.25

855.1658646464  = 855.16

 

I need to get truncated values like above and get a 2 decimal number in the cube level. Kindly suggest a code to achieve this.

 

 

I have seen enough codes on this issue like below however please understand that the values comes from an infoobject with different values . Please suggest a code accordingly.

 

For eg ..

 

DATA: X TYPE P DECIMALS 3 VALUE ‘1.267’,
Y TYPE F VALUE ‘125.456E2’.

WRITE: /X DECIMALS 0, “output: 1
/X DECIMALS 2, “output: 1.27

Here in the above code it is specific to only 1.267 value. I need to work on an infoobject which brings different values. kindly suggest such code.


Viewing all articles
Browse latest Browse all 6437

Trending Articles



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