The grid (core) ยท console.warn
column "{colId}" is declared type "number" b...
Printed by The grid (core), prefixed [lattice], since 1.124.0.
Warnings reference › type.number.precision.*
- Identifier
type.number.precision.*- Raised by
- The grid (core)
- Since
- 1.124.0
What happened
A number column was given a decimal string or a BigInt larger than 2^53 (9,007,199,254,740,992), the limit of what a double holds exactly - a 256-bit token amount, an 18-decimal wei value, a ledger balance in minor units. Strings are read as doubles, so their low digits are rounded; a BigInt is kept as given but compares, sorts and totals as a double. The value still displays as it always did; the warning is the only change, and it is raised once per column, not per value.
The fix
Declare the column type: 'bigint', which keeps every digit through display, sort, filter, totals and export, and add typeOptions: { scale: 18 } to show a raw integer in units.
The smallest fix
createGrid(el, { rows, columns: [{ field: 'amount', type: 'bigint', typeOptions: { scale: 18 }, total: 'sum' }] });
Reference
Covered in full at the API reference.