The sprintf library does not support floating point unless I have a bad
version. I am using version 3.2.1 on a linux box.
Ivan
On Thu, May 08, 2003 at 10:27:51AM -0400, Ivan Galysh wrote:
> Hello,
>
> I need to be able to convert a float to a string and send it to a serial
> port. I have code to send a string to a serial port but can't find
> anything on converting a float to a string.
>
> Ivan
Hi Ivan,
I hope this example will help you.
Pedro
#include<stdio.h>
int main() {
float f;
char s[20];
f = 1.54;
sprintf(s,"%f",f);
// now send string s to the serial port...
}