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.