This switches the output to the traditional SI binary unit suffixes, and
to the decimal metric system unit suffixes.
Change-Id: Icf3b6a0c074ad89014884eed3a9643085ee802cf
(cherry picked from commit cb86f01b33)
Change the function to handle bytes by default, which is what most
callers are passing. Add support for terabytes and petabytes. Switch
kbytes2gigs() to be a wrapper over humanize_bytes() for backwards
compatibility for now until all callers are switched. Remove
unnecessary int() coercion from call sites.
Change-Id: I94be536d73930a453d588e0edbb8192d6844bbe0
(cherry picked from commit 0db028f6e3)
This adds a behavior change, reflected in the unit test changes, by
always returning the lowercased versions of the array elements when
case insensitiveness is enabled. This should be fine, given that we
do not care from the callers PoV, and the result might have changed
depending on the order of the inputs.
Change-Id: I44896183b566e921cc1287f106fb4bb9332acb97
(cherry picked from commit 9485368290)
This makes it possible to easily extend the function to support new
units.
Change-Id: I9e0935fb20013e962e48ec6e27a04d01cd9730be
(cherry picked from commit 7857a1c575)
These are core modules, which require no additional dependencies.
Change-Id: I8dbda5142dcc9d095a2c703ef6cee5364d2ba55a
(cherry picked from commit e6ebcc15c5)
This is a core module, which requires no additional dependencies.
Change-Id: I0830f022788a5e7b69b0afa462654fabf277e254
(cherry picked from commit 018eafb770)
This is a core module, which requires no additional dependencies.
Change-Id: I93a2c3fd75fd7790461ccc694ed73c4899a1ef20
(cherry picked from commit 72d7000151)
Which is also around 300% faster:
Rate had-hoc sprintf
had-hoc 3508772/s -- -75%
sprintf 14084507/s 301% --
Change-Id: I5ebce0058473f9de08c381739646a20e42308a8f
(cherry picked from commit 561e36d08c)