Converting a double to a std::string without scientific notation
As mentioned in the comments of the other answer, your decimal floating point numbers are stored as binary and rarely have finite representations.

If you simply want code that passes your test I would mention that it is much easier to remove padding from std::fixed than it is to expand the scientific notation.

#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;sstream&gt;
#include &lt;limits&gt;
#include &lt;iomanip&gt;
#include &lt;cstdlib&gt;
#include &lt;cassert&gt;
#include &lt;cstddef&gt;

static std::string to_string(double d)
{
    std::ostringstream oss;
    oss.precision(std::numeric_limits&lt;double&gt;::digits10);
    oss &lt;&lt; std::fixed &lt;&lt; d;
    std::string str = oss.str();

    // Remove padding
    // This must be done in two steps because of numbers like 700.00
    std::size_t pos1 = str.find_last_not_of("0");
    if(pos1 != std::string::npos)
        str.erase(pos1+1);

    std::size_t pos2 = str.find_last_not_of(".");
    if(pos2 != std::string::npos)
        str.erase(pos2+1);

    return str;
}


static void test_string_conversion(const std::string&amp; str)
{
    assert( to_string( atof(str.c_str()) ) == str );
}


int main(void)
{
    test_string_conversion( "1.5203" );
    test_string_conversion( "-1.025" );
    test_string_conversion( "3.1415" );
    test_string_conversion( "-38271" );
    test_string_conversion( "0.8382" );
    test_string_conversion( "-0.8382" );
    test_string_conversion( "7" );
    test_string_conversion( "-3" );
    test_string_conversion( "0.0000024" );
    test_string_conversion( "7300000000" );
}