Single precision float value to string

When doing microcontroller programming one may have come across a task of converting a float value to a string. For example when a float value is to be displayed on LCD or it is to be passed out through a UART port. The simple method is to use sprint() function. This function is exactly same as commonly used printf() function. The only difference is that sprint() pass the output to an array instead of some kind of display.

This is an extremely simple way to convert float to string. But the main disadvantages are the memory consumption and time for execution. I have developed a very short and furiously fast code for this conversion. Read the article below.

Full source code for this can be downloaded from here.


Scroll to Top