magnitude icon indicating copy to clipboard operation
magnitude copied to clipboard

Nearest SI prefix

Open trombonehero opened this issue 12 years ago • 1 comments

Love this library, but I have a feature request:

I'd love for a magnitude to have something like .ounit() which means "use whatever SI prefix keeps the displayed magnitude between 0 and 1000". Currently, I have to munge ounit strings, replacing 'M' with 'k' or 'G' where appropriate.

Thanks!

trombonehero avatar Jun 15 '12 12:06 trombonehero

This is exactly what I was looking for. I wrote small python modules in the past for time and file size pretty-printing, and found magnitude when looking for something more general. I am not entirely sure yet whether .ounit() would be the right API; maybe some more explicit .pprint() function would be more appropriate, assuming that your use case also was pretty printing?

hmeine avatar Jan 18 '17 08:01 hmeine