justbases_string._approx module

Generating approximation indicators.

class justbases_string._approx.ApproxPrefix(limits)

Bases: object

Class that transforms numeric value by prepending an approximation prefix, based on the relation. The approximation prefix varies, based on the amount of the difference indicated by the relation.

Initializer.

Parameters:limits (list of Rational, may be the empty list) – the limits of the various buckets

The limits must be all non-zero and in ascending order.

xform(relation, value)

Decorate value with approximation indicator for relation.

Parameters:
  • relation (Rational) – relation of value to value it represents
  • value (str) – a value to decorate

Previous topic

justbases_string package

Next topic

justbases_string._config module

This Page