Skip to content

AggregatorFormatter

Since v0.2.6

Formats the computed aggregation value for display in the cell.

Called after the aggregator function runs. Receives the raw computed value and should return a display string (e.g. currency formatting, unit suffixes).

type AggregatorFormatter = (value: unknown, field: string, column: ColumnConfig) => string
const currencyFormatter: AggregatorFormatter = (value) =>
`$${Number(value).toLocaleString('en-US', { minimumFractionDigits: 2 })}`;
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://toolboxjs.com/llms-full.txt