Suggestion: significant_digits as alternative to decimal_places
cederberg opened this issue · 1 comments
cederberg commented
Sometimes I find it useful to print values with a minimum number of significant digits, instead of locking the number of decimals used. For example, when printing a system memory summary:
3.1 GiB (61.2%) free ∙ 677.1 MiB rss ∙ 1.3 GiB cache ∙ 5.1 GiB total
It is slightly easier to read when a minimum of two significant digits are used, instead of locking the number of decimals to 1:
3.1 GiB (61.2%) free ∙ 677 MiB rss ∙ 1.3 GiB cache ∙ 5.1 GiB total
Would this be an interesting addition to the library?