Skip to content

use Number.isNaN as it's more robust#4895

Merged
azmy60 merged 2 commits into
masterfrom
fix/isNaN
Jun 9, 2026
Merged

use Number.isNaN as it's more robust#4895
azmy60 merged 2 commits into
masterfrom
fix/isNaN

Conversation

@azmy60

@azmy60 azmy60 commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@azmy60 azmy60 added this to the June 2026 Release milestone Jun 5, 2026

@rathboma rathboma left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No bug fixes without tests plz

@@ -10,7 +10,7 @@ export default function(cell, formatterParams, onRendered){
var after = !!formatterParams.symbolAfter;
var precision = typeof formatterParams.precision !== "undefined" ? formatterParams.precision : 2;

if(isNaN(floatVal)){
if(Number.isNaN(floatVal)){

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a test

@azmy60 azmy60 merged commit ea1f81c into master Jun 9, 2026
10 checks passed
@azmy60 azmy60 deleted the fix/isNaN branch June 9, 2026 15:22
pull Bot pushed a commit to TheRakeshPurohit/tabulator that referenced this pull request Jun 9, 2026
…bulator-tables#4895

Adds unit tests validating the isNaN -> Number()/Number.isNaN fixes that
prevent 'Cannot convert a BigInt value to a number' errors:

- Sort.findSorter / ColumnManager.calculateSorterFromValue auto-detect a
  number sorter for BigInt column values (PR tabulator-tables#4894)
- star formatter renders correctly for BigInt cell values (PR tabulator-tables#4895)

Each test throws without its corresponding fix and passes with it.
Mocks are avoided; tests drive a real Tabulator instance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants