Documentation

@kanunilabs/datagrid-react-enterprise


@kanunilabs/datagrid-react-enterprise / ColumnNumberFormat

Interface: ColumnNumberFormat

A number column's display and editing rules (GridColumnDef.numberFormat).

Properties

allowNegative?

optional allowNegative?: boolean

false refuses a negative value (a validation error). Left out: negatives allowed.


decimals?

optional decimals?: number

Fraction digits. The cell shows exactly this many ("1.234,50" with 2); a typed value is rounded to it on save, half away from zero, on the typed digits. 0 asks for whole numbers (the editor offers inputMode="numeric"). Left out: shown and stored as typed.


locale?

optional locale?: string

BCP 47 locale for the separators, e.g. 'tr-TR'. Default: the grid's locale ('tr' → 'tr-TR'), never the browser's language.


max?

optional max?: number

Largest accepted value; above it the editor shows a validation error.


min?

optional min?: number

Smallest accepted value; below it the editor shows a validation error.


restrictInput?

optional restrictInput?: boolean

Refuse, while typing, what can never become a number here (React grid): a letter, a second decimal separator, - anywhere but first (or at all with allowNegative: false), a separator with decimals: 0. The key simply does nothing. A paste or drop is taken when the whole text then reads as a number (thousands separators included). Deleting is always free; an IME word is judged once it is finished. Default false: anything may be typed and a non-number is refused on commit (the validation message).


step?

optional step?: number

ArrowUp / ArrowDown in the editor add / subtract this (Ctrl or Cmd: ten times as much). Left out, the arrows stay the text box's own.


thousands?

optional thousands?: boolean

Thousands separators in the cell. Default true. The editor never shows them.