Many programming languages that use IEEE 754 doubles provide a library function to convert those doubles to strings. For example, C has sprintf
, C++ has
See Ryan Juckett's Printing Floating-Point Numbers (2014), which describes history and implementations of floating-point to string conversions. In this four-part post, Ryan also provides a C++ implementation of Dragon4 based on Steele and White (1990), which is an efficient algorithm to convert a binary number in floating point format to a decimal number in string format.
You can also see a C implementation of Ryan's Dragon4 for Numpy here, and use it within Python/Numpy 1.14 format_float_positional and format_float_scientific functions.
In 2018, an algorithm/library Ryu was published, with bindings in many modern programming languages (C, Java, C++, C#, Scala, Rust, Julia, Go, ...)