
23 Nov
2009
23 Nov
'09
2:56 p.m.
AMDG Paul A. Bristow wrote:
I'd like to use the units library prefix (k, M, G ...) system, but I'd really like to determine the prefix dynamically (automatically) depending on the value.
For example, if I have a length of 12300 m I'd like an output of "12.3 km" but if my length is 0.0123 m, I'd like an output of "12.3 mm".
I can't see how to do this (and including the correct length unit of m or meter of course).
Suggestions?
There is no way to do this right now. Currently the output operator completely separates printing the value from printing the unit. Feel free to add a feature request in trac. I can't think of a good name for a stream manipulator off hand. In Christ, Steven Watanabe