decimal points with stringstream
i have a bunch of integers that i put into stringstreams. Now i want to change the stringstreams into strings while keeping a constant precision with the strings. how would i do that? i know i can use `stringstreams.precision()`, but its not working for some reason.


    float a = 5.23;
    float b = 3.134;
    float c = 3.0;
 
    
    std::stringstream ta;
    std::stringstream tb;
    std::stringstream tc;
    
    ta << a;
    tb << b;
    tc << c;
    
    ta.precision(2);
    tb.precision(2);
    tc.precision(2);
    
    std::string out = "";
    out += ta.str() + "\n";
    out += tb.str() + "\n";
    out += tb.str() + "\n";

will return `5.23\n3.134\n3.0`, rather than `5.23\n3.13\n3.00`
decimal points with stringstream
===

i have a bunch of integers that i put into stringstreams. Now i want to change the stringstreams into strings while keeping a constant precision with the strings. how would i do that? i know i can use `stringstreams.precision()`, but its not working for some reason.


    float a = 5.23;
    float b = 3.134;
    float c = 3.0;
 
    
    std::stringstream ta;
    std::stringstream tb;
    std::stringstream tc;
    
    ta << a;
    tb << b;
    tc << c;
    
    ta.precision(2);
    tb.precision(2);
    tc.precision(2);
    
    std::string out = "";
    out += ta.str() + "\n";
    out += tb.str() + "\n";
    out += tb.str() + "\n";

will return `5.23\n3.134\n3.0`, rather than `5.23\n3.13\n3.00`