fault.format

Human readable count (number) formatting using metric symbol suffixes.

steps
data

steps = [
	('', '', 0),
	('kilo', 'k', 3),
	('mega', 'M', 6),
	('giga', 'G', 9),
	('tera', 'T', 12),
	('peta', 'P', 15),
	('exa', 'E', 18),
	('zetta', 'Z', 21),
	('yotta', 'Y', 24),
]

precision
function

precision(count)

Find the prefix, suffix, and power that the given count should be classified as.

metric
function

metric(value, decimal)

Construct a sequence of strings that make up the formatted text to be printed.

metricParameters

value

The number to be formatted.

decimal

The character that should be used to separate the whole and fraction.

formatting

Undocumented.

metricReturns

  1. Whole number portion.

  2. Decimal point. Defaults to ..

  3. Fractional portion of the number in decimal.

  4. Metric suffix; empty string if less than 1000.