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

Problem in Convert

Former Member
0 Likes
601

Hi

how can i convert 5.6000000000000000E+03

to 5600?

Maybe there is any Fm taht do it

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
579

Hi..

<b>data: w_f type f value '5.6000000000000000E+03',

w_i type i.

w_i = w_f.

write w_i.</b>

5 REPLIES 5
Read only

Former Member
0 Likes
579

Hi,

Move that value to <b>type P</b> ( <b>Packed</b> ) field.

Regards,

Balavardhan.K

Read only

0 Likes
579

Hi Balavardhan.K

The type of the field must be char

Read only

0 Likes
579

See this

data : var type p ,

var1 type f value '5.6000000000000000E+03'.

move : var1 to var.

write : var.

you will get 5,600 in <b>VAR</b>.

Read only

Former Member
0 Likes
580

Hi..

<b>data: w_f type f value '5.6000000000000000E+03',

w_i type i.

w_i = w_f.

write w_i.</b>

Read only

Former Member
0 Likes
579

Hi..,

Just move that value into a variable of type INTEGER ( i.e either Type P or I ).. it will be automatically converted to 5,600.

Check this code..

<b>

data w_fload type f value '5.6000000000000000E+03'.

data w_int type i.

w_int = w_float.

write w_int.

*****************************************

The output is 5,600.

*****************************************</b>

reward all helpful answers..

sai ramesh