This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Float to ascii conversion 8052

Hi
I am looking for source for 8052.
Float to ascii conversion
float "lenght" is in the range
-99999.999 to 99999.99
Thank you very much

mbosko@ptt.yu

Parents
  • I would think that the easiest thing to do (in terms of typing effort) is to use sprintf() from the standard C library.

    #include <stdio.h>

    sprintf (buf, "%4.2f", Length);

    sprintf() is a big function, as it has a lot of capabilities. Check the manual for the specifiers for the format string, which let you control how the value looks in ASCII.

Reply
  • I would think that the easiest thing to do (in terms of typing effort) is to use sprintf() from the standard C library.

    #include <stdio.h>

    sprintf (buf, "%4.2f", Length);

    sprintf() is a big function, as it has a lot of capabilities. Check the manual for the specifiers for the format string, which let you control how the value looks in ASCII.

Children