Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Remove Zero After Point.

0 Likes
1,722

Hi experts,

i have a Amount Field KBETR . in result I got value as '000000.0000000' but i want as '0000.00'.

i used shift trailing and many thing but not get result in write way.

thanks and Regards,

Yasir haider.

1 ACCEPTED SOLUTION
Read only

ThorstenHoefer
Active Contributor
0 Likes
1,415

Hi Yasir,

you have also fomat option DECIMALS

https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcompute_string_format_options.htm

data(string)=|{ amount_internal DECIMALS = 0}|.
2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,415

It's a currency amount so you should format it according to the corresponding currency code and it will then contain the number of decimals defined for the currency code. For instance USD and EUR have 2 decimals, so the formatting would be automatically 0.00.

Please search currency decimals formatting in the forum. WRITE CURRENCY or string template

DATA(amount_internal) = CONV kbetr( '3.1416' ).

data(string) = |{ amount_internal CURRENCY = 'EUR' }|. " currency has 2 decimals

ASSERT string = '314.16'.
Read only

ThorstenHoefer
Active Contributor
0 Likes
1,416

Hi Yasir,

you have also fomat option DECIMALS

https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcompute_string_format_options.htm

data(string)=|{ amount_internal DECIMALS = 0}|.