Search code examples
reactjsreact-bootstrap-table

Sorting number with comma in react-bootstrap-table2


Using react-bootstrap-table2, When trying to filter large numbers with commas (12,000) it doesn't work. Is it possible to filter numbers with commas?

example enter image description here

Cheers!


Solution

  • Without seeing your code it is hard to say. But perhaps each cell data in your table is a string, not a number, which could cause sorting weirdness. I had same issue before. Sort it by number, then populate your table cells with the formatted string version of the number after sort, if that makes sense.