More formatting questions

A while back some of you helped out with a formatting question I had (http://www.dev-archive.com/forum/showthread.php?t=430279) with STL.

I have another:

It's been decided that the units measure is needed in the log. That's okay - I already send the formatted value off as a std::string because different values are measured to different resolutions, and certain types are transformed into human readable values (think hh:mm:ss, degrees, radians, etc.).

So I have them in textual format but there is still the readability factor: 0.000m
0:00:00.126ss
1.32mV
(Other preceding fields have been left out for brevity)

So I was trying to think of a way of getting the value to line up with the text after it, but I am getting into a mass of code and conditional statements.

So without pasting my shocking attempt I was wondering how others would do it: Remember I have a formatted value and want to get the trailing numbers to line up. Throwing a spanner in the works is the problem of boolean values - open/closed, on/off etc.

Currently I am inserting a space between the value and the unit of measurement. Then I am counting how long the unit of measurement is, subtract that from the longest unit value, and add the difference in spaces and then write out the log, which works, but feels clunky and looks wrong: Item Value
----
0.000 m
0:00:00.126 ss
1.32 mV

I think the formatting could be solved by changing the setw parameter but that doesn't solve the clunkiness of the solution.
[1639 byte] By [grahamr -work] at [2007-11-20 11:17:48]