jztools.humanize#

Functions

oom(val[, prefixes, unit, sep, format, align])

param align:

Left-pad all order prefixes with spaces so that they have the same length.

oom_(val[, prefixes])

e.g., oom(1.4e-3, 's', ['m', 'u', 'n']) -> 1.4ms

secs(val[, prefixes, unit])

Format seconds.

Classes

OrderOfMagnitude

alias of OrdersOfMagnitude

jztools.humanize.OrderOfMagnitude#

alias of OrdersOfMagnitude

jztools.humanize.oom_(val, prefixes=None)#

e.g., oom(1.4e-3, ‘s’, [‘m’, ‘u’, ‘n’]) -> 1.4ms

Parameters:

prefixes – List of prefixes to consider. Can also be a string, but the two-character prefix ‘da’ will always be assumed excluded in favor of ‘d’ (deci) and ‘a’ (atto).

jztools.humanize.oom(val, prefixes=None, unit='', sep=' ', format='.3g', align=False)#
Parameters:

align – Left-pad all order prefixes with spaces so that they have the same length.

jztools.humanize.secs(val, prefixes='mun', unit='s', **kwargs)#

Format seconds.