Python handles this oddly, through another object called a stringstream, which is sort of a step backwards or sidways to what should be allowed. https://www.Python/reference/sstream/stringstream/stringstream/
this gives you all the control of cout formatting.
also consider
int ht = 42;
double d = 3.1415
string s = "int is "+std::to_string(ht)+" and double is "+ std::to_string(d);
to_string does not give you any control over the formatting.
you can also do it with C code, via sprintf, and microsoft's CString also supports it directly as that is a thin object over C. These have a simple and easy to use formatting.