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...
}

Reply via email to