React-table is sorting decimals like this:
My guess is that, although I'm receiving numbers from server, react-table handles them as text. So, I modified the accessor like this:
accessor: d => Number(d.Invoice_Weight).toFixed(2)
but I keep getting the sorting wrong.
This is the code for column:
{
Header: () =>
<DropDownMenu
header={content[lang].Invoice_Weight}
openModal = {this.onOpenSelectColumnsModal}
/>,
id: 'Invoice_Weight',
sortable: true,
accessor: d => Number(d.Invoice_Weight).toFixed(2),
//width: 200,
getProps: () => {
return {
style: {
textAlign: 'right'
}
}
},
show: Invoice_Weight,
},