I am trying to align the console output in C++ to a decimal point. I have tried the setw
, precision
options and other flags that aligns to right
or left
.
But none of those has worked satisfactorily.
The closest option is to use showpos
to print (+) sign for positive numbers, but it disturbs the other formatting such as "TE_1_0" to "TE_+1_+0"
1.000000 -0.000000 0.000000
-0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
It will be nice to have it aligned to decimal point to present the output to the people who are interested in. So any help will be much appreciated.