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 type floating value

Former Member
0 Likes
813

Hi ,

while passing value to a variable as 12000000.85, it got converted to value 1.200000085E7.Is it floating value? How to convert this floating value to character value which will be again converted to 12000000.85?

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
738

Try out this.

Data:p_float type f value '1.200000085E7',
     p_packed type p decimals 2,
     w_char(12).

p_packed = p_float.
w_char = p_packed.

write : w_char.

Regards,

Gurpreet

4 REPLIES 4
Read only

Former Member
0 Likes
738

Hi,

Check these FM's

CHAR_FLTP_CONVERSION_TO_SI

CHAR_FLTP_CONV_TO_SI_RFC

FLTP_CHAR_CONVERSION_FROM_SI

FLTP_CHAR_CONV_FROM_SI_RFC

Read only

Former Member
0 Likes
738

Use ABS statment.

Example:

data : netpr type ekpo-netpr,

amount(17) type c.

amount = ABS( netpr ).

Amount(char field) will have ur value.

Regards,

Aswin.

Read only

Former Member
0 Likes
739

Try out this.

Data:p_float type f value '1.200000085E7',
     p_packed type p decimals 2,
     w_char(12).

p_packed = p_float.
w_char = p_packed.

write : w_char.

Regards,

Gurpreet

Read only

Former Member
0 Likes
738

yes you can use direct assignments to move data from fltp to char and char to fltp.

Regards,

Lalit Mohan Gupta.