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

converting the value

Former Member
0 Likes
1,031

Hi experts,

How to convert 6.800000000000000E+02 to 680?

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

thanks

kaki

5 REPLIES 5
Read only

Former Member
0 Likes
814

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'

Read only

Former Member
0 Likes
814

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.

Read only

vinod_gunaware2
Active Contributor
0 Likes
814

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

Read only

0 Likes
814

THANKS FOR ALL THE REPLIES.

POINTS ALLOTED

CHEERS

KAKI

Read only

0 Likes
814

Hi Kaki,

Did you Check the Sravanthi's Post.

Don't forget to reward for helpful answers.

Regards

vijay