Skip to Content

Reg the Decimal Values

Hi all,

I have a requirement where i have to sum up all the local curreincies for a given fiscal years.

so while summing up i am moving the amount to a string varaiable. But if the amount consists of zeros in the decimal places then the decimals are not being replicated in the string variable.

For ex.

loop at itab.

x = x + itab-dmbtr.

endloop.

in the above ex if the total value of x(where x is of type string) is eq 50.00 then i am not able to display the decimals zero in the output. I declared the varaible x as string because the summation value is exceeding the length of the amount feild.

But if my total value of X is say 50.05 or 50.25 i am able to get these decimal places in the output. But if my total summation value contains zeros in the decimal places in the last i am not able to get those,like 50.00 or 50.20 , these are being displayed as 50 and 50.2.

Can anyone suggest..

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 19, 2008 at 08:35 AM

    Hi Rajesh,

    Is there any special reason behind taking currency field as string it looks interesting. check this .00 is displaying completely.

    DATA: A(7) TYPE P DECIMALS 2 VALUE 1234567.

    A = A + '.00'.

    WRITE: 'ANSWER', A.

    Any issues using the above example revert back.

    Cheers!!

    Balu

    Add comment
    10|10000 characters needed characters exceeded