Application Development 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: 

converting the value

Former Member
0 Kudos

Hi experts,

How to convert 6.800000000000000E+02 to 680?

Can any one give me FM pls...!!

thanks

kaki

5 REPLIES 5

Former Member
0 Kudos

Declare a variable of type P (Packed) and move your Float value into it.

For ex:

data: p type p,

f type f value '10'. " It writes '1.0000000000000000E+01'

write: f.

p = f.

write:/ p. "writes '10'

Former Member
0 Kudos

Hi Kaki,

I don't think you need a FM for this purpose,

Just assign the value to an integer value.

This will work.

As an example, just check this.

data: a type f value 680 ,

b type i.

b = a.

Now b will be displayed as 680.

Hope your query is solved.

Regards,

SP.

vinod_gunaware2
Active Contributor
0 Kudos

Create variable ot I assingn this variable to interger variable.

Type I is always treated in the same way as type P without decimal places. Wherever type P is mentioned, the same applies to type I fields.

If the program attribute Fixed point arithmetic is set, the system rounds type P fields according to the number of decimal places or fills them out with zeros.

regards

vinod

0 Kudos

THANKS FOR ALL THE REPLIES.

POINTS ALLOTED

CHEERS

KAKI

0 Kudos

Hi Kaki,

Did you Check the Sravanthi's Post.

Don't forget to reward for helpful answers.

Regards

vijay