cancel
Showing results for 
Search instead for 
Did you mean: 

Set zeros after decimal point

Former Member
0 Kudos

Hi All,

I have to set all the numbers after the decimal point to zero and I have no idea how to do it.

e.g. in program the total is 19220.12 and I have to change it to 19220.00.

So how to do it in ABAP ??

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member202684
Contributor
0 Kudos

Hi,

You can do it like this


DATA A TYPE P DECIMALS 2 VALUE '19220.12'.
DATA B TYPE P DECIMALS 2 VALUE .

B = TRUNC( A ).

Result would be as you need. i.e.19220.00

Check this [link|http://help.sap.com/saphelp_470/helpdata/en/fc/eb3316358411d1829f0000e829fbfe/content.htm]

Regards,

Joe