Discussion:
Higher accuracy output from human_readable()
(too old to reply)
Darshit Shah
2016-09-15 21:54:46 UTC
Permalink
Raw Message
Hi,

I'm trying to use the human_readable() method from module human. I am
currently using it with the following options:

human_autoscale | human_base_1024 | human_SI | human_B | \
human_round_to_nearest | human_group_digits

It shows the value correctly with one decimal point up to 10 MiB. Beyond
that, the function always returns a value without any decimal points. I
would like the function to always return a value with 2 decimal points,
even if it means returning xx.00 MiB for example. How can I achieve this
using the module?
--
Thanking You,
Darshit Shah
PGP Fingerprint: 7845 120B 07CB D8D6 ECE5 FF2B 2A17 43ED A91A 35B6
Paul Eggert
2016-09-16 16:03:23 UTC
Permalink
Raw Message
Post by Darshit Shah
would like the function to always return a value with 2 decimal
points, even if it means returning xx.00 MiB for example. How can I
achieve this using the module?
It doesn't support that now. I suppose you could add an option....
Loading...