std::to_string(double) is defined by the standard to just return the same sequence of characters that would be generated by sprintf(buf, "%f", value). No more, no less, especially no way to tweak the format specifier. So no, there is nothing you can do.