-
I am retrieving dynamic data from my database and I'm trying to format large numbers in my table such that 10000 will be displayed as 10,000. Previously, before using react-table, I was mapping each row and I used toLocaleString() to convert large numbers. However, with react-table, I'm unsure as to how to do it. Is this even possible? My code is the exact same as the one displayed on https://react-table.tanstack.com/docs/examples/sorting, except I'm retrieving data dynamically. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
hi @praj18
|
Beta Was this translation helpful? Give feedback.
hi @praj18
use it like this
columns = [{ accessor: 'updated_at', Cell: ({ value }) => humanizeDaysAgo(value) }]
Cell: ({ value }) => helpers.formatnumber(value)