react-pivottable
react-pivottable copied to clipboard
Formatting Numbers
Thanks for the library! I had a quick question about formatting numbers in the table. Based on what I read, there's no good way to implement this right now. I've seen numberFormat in Utilities.js as well as documentation from the previous library on Localisation (which is on the roadmap).
I just wanted to confirm this is correct and there's no good way to format numbers (with commas for example) until localisation is pushed. If this is so, do we know when it will be released?
@perryclee01 If you want to use your own format in pivottable, you might want to start with the TableRenders.jsx
component,you can see the final result is formatted by something like this
{aggregator.format(aggregator.value())}
So you can rewrite this logic and have your own format. I managed to add a percentage format in my project and it's pretty well.
@perryclee01 If you want to use your own format in pivottable, you might want to start with the
TableRenders.jsx
component,you can see the final result is formatted by something like this{aggregator.format(aggregator.value())}
So you can rewrite this logic and have your own format. I managed to add a percentage format in my project and it's pretty well.
Hello, i want to format Totals
value, how to get it? Thank you.
I guess you just want to format the Total row/col ?
I guess you just want to format the Total row/col ?
Yes.
I guess you just want to format the Total row/col ?
e.g. Rows values like: 3.4k, 1.2k, 1.1k. Totals row should equels 5.7k, but now totals row is 5.70.
Any news on that?