cancel
Showing results for 
Search instead for 
Did you mean: 

remove decimal & zeros in variable

Former Member
0 Kudos

Hi,

How to remove zero & decimal point in variable

for eg.

insted 5.0000 it should priint 5

Thanks

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Dear Imran,

Please use this code and you can vary the difference.

data: menge type MENGE_D,

con type i,

con1 type char5,

con2 type p,

con3 type n.

menge = '100.00'.

move menge to con.

move menge to con1.

move menge to con2.

move menge to con3.

    • con1 = menge.*

    • con2 = menge.*

    • con3 = menge.*

write: 'i', con,

'char', con1,

'p', con2,

'n', con3.

i think this will be help ful to you

Regards,

Kiran Kumar

Former Member
0 Kudos

Hi Imran

data : x type f .

data : y type I.

x = '5.0000' .

y = x.

write y.

Former Member
0 Kudos

Hi,

try it with:

replace '.' with '' into text.

replace '000' with '' into text.

text is your variable

regards

Nicole

Edited by: Nicole Lorenz on Jan 17, 2008 2:17 AM

former_member188829
Active Contributor
0 Kudos

Hi,

Declare that variable type N

Check this example..

DATA:X TYPE P DECIMALS 4.

DATA:Y TYPE N.

X = 5.

Y = X.

WRITE:X , Y.