Here's a related topic.
I'm looking for something slightly different, I'm printing out a 4x4 floating point matrix. In fact I'm using this prettyprint method to do it, which will preclude me from using printf
formatting which I'm a little more familiar with.
I can set ios_base::width()
to set a minimum width to pad out the zeros and ones but the likes of 0.6666667
screws up the alignment. I figure I can set precision
but it only affects the number of significant figures and not the total number of char's produced by the value. I can't seem to use unsetf
on an ostream
to set 'default notation'... Even if I could do that I suspect a minus sign would mess up alignment anyway.
Is there a workaround?