summarywidget icon indicating copy to clipboard operation
summarywidget copied to clipboard

Request for new Enhancement - Adding formats to the output

Open KanchanMenghnani opened this issue 7 years ago • 1 comments

Hi, thank you so much for summarywidget!

I was wondering if there is a way to add formatting options for the output of summarywidget. For Example- adding "," for numbers and $ values for currency columns

Thank you very much

KanchanMenghnani avatar May 21 '18 07:05 KanchanMenghnani

Hello,

thank you as well. I'm also interested in such a feature and was looking into the JavaScript code. I guess one possible solution could be to replace the toFixed method on line 54 in summarywidget.js with the toLocaleString method. Here is an example:

123456789.12345679.toLocaleString("de-AT", {minimumFractionDigits: 6, maximumFractionDigits: 6, style: "currency", currency: "EUR"})

"€ 123.456.789,123457"

The R function of the widget could then be adapted to take a locales argument along with a list argument for options similar to the datatable function of the DT widget.

What do you think?

gisler avatar May 07 '20 14:05 gisler