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 float to char

Former Member
0 Likes
694

Hi,

My float value is 2.0092323000000000E+05

I want to convert it to char type.

the value should be 200923.23

how to do it.

Regards,

Ravi G

3 REPLIES 3
Read only

Former Member
0 Likes
602

use fm CEVA_CONVERT_FLOAT_TO_CHAR.

but if you are taking at type p variable it will automatically take the value

data v_p type p decimals 2.

v_p = <your float value>

write : / v_p.

regards

shiba dutta

Read only

Former Member
0 Likes
602

hi

declare a variable of type p decimals 2 and pass it to it..

data a type f value '2.0092323000000000E+05'.

data b type p decimals 2.

b = a.

write a.

write b.

if helpful, reward

Sathish. R

Read only

Former Member
0 Likes
602

Hi,

Try this..

Convert the float value to type P and then convert it to char..

DATA: PACKED TYPE P DECIMALS 2.

PACKED = FLOAT.

CHAR = PACKED.

Thanks,

Naren