Skip to main content

Module table

Module table 

Source
Expand description

The flat table renderer.

Two rules earn this module its existence:

  • A cell is an enum, not a string. A report cannot accidentally hand the renderer a 0 for a value its adapter cannot populate — it must say Cell::Unsupported, which renders as a dim : unsupported columns are greyed out rather than printing a misleading 0.
  • Estimates are marked at the point of rendering: Cell::Money carries an estimated flag, prints a trailing ~, and triggers the legend footer.

Structs§

Style
Whether rendering may emit ANSI escapes.
Table
A headed, dynamically-sized table.

Enums§

Cell
One rendered value. Numeric variants align right; text aligns left.

Constants§

UNSUPPORTED
Placeholder for a KPI the source adapter cannot populate.

Functions§

format_count
Human-readable counts: plain below 1000, k below a million, then M.
format_money
Currency, with a trailing ~ when the figure is an estimate and ~+ when it is an estimate that also omits spend it could not price.