I would like to rewrite something like
to something likeCode:sprintf(str, "%d, %.1lf, %.3lf, %.2lf, ...", a, b, c, d, ....)
But is there a way to specify varying precision easily (there are about 100 values to be converted to a string with varying precisions.)? Something likestringstream str<<a<<fixed<<b<<c<<d ...
Possible? If so then what's the syntax? Thanks!Code:... <<%.1<<b<<%.3<<c<<%.2<<d ...




Reply With Quote