converting float to char string

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

converting float to char string

3,828 Views
rickross
Contributor I
I am currently using Codewarrior 5. I want to write float numbers to Hyperterminal using the write command but so far I have been unsuccesful. I can however write characters. I tried using the gcvt() function to convert the float to a character string but codewarrior doesn't recognise it. Any ideas or examples or application notes I can use to write floats to Hyperterminal? 
Labels (1)
Tags (1)
0 Kudos
Reply
1 Reply

980 Views
CrasyCat
Specialist III
Hello
 
What about using printf?
sprintf can be used to convert a float to a string (array of char).
Several output format are possible. Please check ANSI C documentation to find out the one which suits best your needs.
 
CrasyCat
0 Kudos
Reply