caellion-python-commons
|
This class provides various number formats. More...
Public Member Functions | |
def | formatSI (v, dec=0) |
Formats number as an SI-prefixed decimal. More... | |
def | formatBinarySI (v, dec=0) |
Formats number as an SI-prefixed decimal, using binary unit prefixes (ki, Mi, etc.) More... | |
def | formatSISubValue (v, dec=0) |
Formats less-than-one numbers to an SI-prefixed decimal (using prefixes like m, μ) More... | |
def | formatSIBinarySubValue (v, dec=0) |
Formats fractional number to SI-prefixed decimal using binary unit prefixes. More... | |
def | formatSIFullRange (v, dec) |
Formats number using full range (will format numbers below 1 with subvalue variant) using SI decimal unit prefixes. More... | |
def | formatUnitsPerIntervalDynamic (units, seconds, unit) |
Generates an expression like "1.0kg/year". More... | |
This class provides various number formats.
Definition at line 16 of file formatters.py.
def caellion.pycommons.stringutil.formatters.NumberFormatting.formatBinarySI | ( | v, | |
dec = 0 |
|||
) |
Formats number as an SI-prefixed decimal, using binary unit prefixes (ki, Mi, etc.)
v | Number to be formatted |
dec | Number of decimal places |
Definition at line 50 of file formatters.py.
def caellion.pycommons.stringutil.formatters.NumberFormatting.formatSI | ( | v, | |
dec = 0 |
|||
) |
Formats number as an SI-prefixed decimal.
v | Number to be formatted |
dec | Number of decimal places |
Definition at line 21 of file formatters.py.
def caellion.pycommons.stringutil.formatters.NumberFormatting.formatSIBinarySubValue | ( | v, | |
dec = 0 |
|||
) |
Formats fractional number to SI-prefixed decimal using binary unit prefixes.
Definition at line 111 of file formatters.py.
def caellion.pycommons.stringutil.formatters.NumberFormatting.formatSIFullRange | ( | v, | |
dec | |||
) |
Formats number using full range (will format numbers below 1 with subvalue variant) using SI decimal unit prefixes.
v | Number to be formatted |
dec | Number of decimal places |
Definition at line 120 of file formatters.py.
def caellion.pycommons.stringutil.formatters.NumberFormatting.formatSISubValue | ( | v, | |
dec = 0 |
|||
) |
Formats less-than-one numbers to an SI-prefixed decimal (using prefixes like m, μ)
v | Number to be formatted |
dec | Number of decimal places |
Definition at line 80 of file formatters.py.
def caellion.pycommons.stringutil.formatters.NumberFormatting.formatUnitsPerIntervalDynamic | ( | units, | |
seconds, | |||
unit | |||
) |
Generates an expression like "1.0kg/year".
units | amount of units that have happened over measurement interval |
seconds | measurement interval, expressed in seconds |
unit | name of unit (kg in example above) |
Definition at line 134 of file formatters.py.