number<T> static method

ReadableColumn<T> number<T>(
  1. String label, {
  2. required num value(
    1. T v
    ),
  3. int decimals = 2,
  4. String? suffix,
  5. double? width = 130,
  6. bool sortable = true,
  7. bool colorSign = false,
})

Right-aligned monospace number with grouping + decimals.

Implementation

static ReadableColumn<T> number<T>(
  String label, {
  required num Function(T v) value,
  int decimals = 2,
  String? suffix,
  double? width = 130,
  bool sortable = true,
  bool colorSign = false,
}) =>
    ReadableColumn<T>(
      label,
      type: ReadableColumnType.number,
      width: width,
      align: ReadableAlign.end,
      sortable: sortable,
      sortKey: (v) => value(v),
      cell: (ctx, v) => ReadableCells.number(value(v), decimals: decimals, suffix: suffix, colorSign: colorSign),
    );