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

exponential to decimal

Former Member
0 Likes
3,124

hello friends,

how do v convert a exponential number(1.0199999999999999E+01) to a normal decimal number.

actually there is a keyword which can be used to convert the exp number into decimal in one step.

exp1 = 1.0199999999999999E+01.

int = keyword ( exp1 ).

does any1 have any idea about what that keyword would be?

anyother way to convert will also do

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,410

Hi Amit,

Check this,

data:

SOLLWERT type QPMK-SOLLWERT,

temp(16) type p decimals 2.

SOLLWERT = '1.0199999999999999E+01'.

move SOLLWERT to temp.

write: SOLLWERT,temp.

Thanks.

hello friends,

how do v convert a exponential number(1.0199999999999999E+01) to a normal decimal number.

actually there is a keyword which can be used to convert the exp number into decimal in one step.

exp1 = 1.0199999999999999E+01.

int = keyword ( exp1 ).

does any1 have any idea about what that keyword would be?

anyother way to convert will also do

6 REPLIES 6
Read only

Former Member
0 Likes
2,411

Hi Amit,

Check this,

data:

SOLLWERT type QPMK-SOLLWERT,

temp(16) type p decimals 2.

SOLLWERT = '1.0199999999999999E+01'.

move SOLLWERT to temp.

write: SOLLWERT,temp.

Thanks.

Read only

0 Likes
2,410

hi viji,

i am getting a dump wen i do as told by u

Read only

0 Likes
2,410

Hi Amit,

For me its working fine and I got the ouput as 10.20 from your input.

Check this code in separate Program.

Thanks.

Read only

0 Likes
2,410

yeah thanks,

it worked for me also now

Read only

Former Member
0 Likes
2,410

DATA: RESULT TYPE F,

PI(10) VALUE '3.141592654'.

RESULT = EXP( PI , 4).

WRITE RESULT.

Read only

Former Member
0 Likes
2,410

Hi Amith.,

u just decalre another variable of type integer

Most ABAP Data types are inter-convertible.

So just assign the value to integer or character variable.

For eg:

data: F TYPE F VALUE '280.234',

I TYPE I .

I = F.

WRITE : I , F.

This will work..

SAP will take care by itself the conversion thing.

test it.

<b> Reward if answer solves the problem</b>

Chandra

Message was edited by:

Chandrasekhar V