Skip to content

Got incorrect sort when the content of cell is the numeric value of the float type. #818

Open

Description

@noeyy-mino

I insert one cell to store the numeric value of the float type in summary section as following shown.
cells.insert(11, '<th class="sortable" data-column-type="speedup">speedup</th>')

And the speedup is the numeric value of the float type.

In genericSort fuction, convert the value of cell into lowcase, I think should check whether the value is a numeric type.
If yes, should return parseFloat(a[key]) - parseFloat(b[key])

sorted = list.sort((a, b) => { if (!isNaN(parseFloat(a[key])) && !isNaN(parseFloat(a[key]))){ return parseFloat(a[key]) - parseFloat(b[key]) } return a[key] === b[key] ? 0 : a[key] > b[key] ? 1 : -1 })

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions