KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Commas in numbers #2053

Closed Gal Engineers opened this topic on on May 4, 2021 - 1 comments

Gal Engineers commented on May 4, 2021

Hey, I'm trying to use a Datagrid template, client_rowgroup I would be happy if there were commas in the amount, thanks!

Sebastian Morales commented on May 5, 2021

Pls try the "format" property of clientRowGroup's calculate like this:

                "clientRowGroup" => [
                    "productLine" => [
                        'direction' => 'desc',
                        'calculate' => [
                            'totalSales' => ['sum', 'dollar_sales',
                                "format" => "function(value) {return value.toLocaleString();}",
                            ], 

You could replace the javascript function toLocaleString() with any custom number format function or javascript code that you like. Let us know if this works for you. Rgds,

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
solved

None