With fmt library (or std::format) I can do formatting like in the example below
#include <fmt/core.h>
int main() {
double x = 2.0/3.0;
fmt::print("{:*^30}\n", x); //print ******0.6666666666666666******
fmt::print("{:+.3e}\n", x); //print +6.667e-01
}
In the above code, I can:
- Use the first formatting to center x and pad with *.
- Use the second formatting to format x in scientific notation with 3 decimal places and a +.
How can I combine both of these to get this?
**********+6.667e-01**********