Pivot Table Widget: Format Decimal With Comma?

0
Hi – I’m using the pivot table widget from the app store. In my cell summed values, is there a way to format them with a comma? The developer of the “pivotdata” widget is below … Marcel, if you happen to come across this question (or anyone), would love a tip/pointer on how to format decimal in the widget to include comma/group digit. I went through the widget code, and am not sure where to begin. Thanks Marcel Groeneweg (Synobsys)
asked
3 answers
1

Please use the ITvisors version, the Synobsys version is no longer maintained, For decimal formatting it follows the model settings.

answered
0

Confirmed I am using the ITvisors version; is there any way for me to customize the widget to group digits by a comma? I saw the following code in the widget … Would I modify this line of code to perform a different function? I’m sorry, I’m new to javascript.

node.innerHTML = this.formatDecimal(cellValue);

answered
0

This is what I’m thinking of applying per https://blog.abelotech.com/posts/number-currency-formatting-javascript/. Then I plan to apply this function by → node.innerHTML = this.formatNumber(cellValue);

Somehow this change is not working. Still no comma but still researching.

function formatNumber(num) {
  return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,')
}
answered