Currently when you want to display a "$" sign or "%" you've got to change the raw data:
customColumnTypes='[
{
"name": "Custom type",
"customTextProcessing": {
"changeTextFunc": "(cellText) => `$${Number(cellText.replace(/[^0-9.-]+/g,\"\"))}`",
"changeStyleFunc": "(cellText) => {
const moneyNumber = Number(cellText.replace(/[^0-9.-]+/g,\"\"));
if (moneyNumber < 20) return {backgroundColor: `#ff3232`};
if (moneyNumber < 100) return {backgroundColor: `#ffff00`};
return {backgroundColor: `#00ac00`};
}"
}}]'
So for example 0.12 should show as 12%. However to get it working you need to change the actual value to 12%. This is bad when when you have to send it back to a server.
Recommendation for a "changeDisplayFunc" function. It would happen after changeTextFunc (for example cleaning data to only display numbers). In the example 0.12:
customColumnTypes='[
{
"name": "Percentage",
"customTextProcessing": {
"changeDisplayFunc": (cellText) => `${Number(cellText) * 100 }%`
}}]'
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too