0

I am using Kartik GridView in yii2 project.

When I specify column format as decimal it shows the output as 112,233,335.

I want this number as 11,22,33,335.

How can I do so ? I also want page summery for this column in the same comma separated format.

arun
  • 165
  • 1
  • 17

2 Answers2

0

you can set it :

['format'=>'number', 'decimals'=>2, 'decPoint'=>'.', 'thousandSep'=>',']

change 2 to which you desire .

kiamoz
  • 714
  • 1
  • 7
  • 18
0

the following code worked for me:

        'pageSummaryFunc' => function ($data) { 
            array_walk($data, function (&$v) {
                $v = intval(preg_replace('/[^\d.]/', '', $v));
            });
            return General::getInrFormat(array_sum($data));
        },

In this code I specify what to display and how to calculate page_summary for the column. getInrFormat() is my own function which returns the numeric value in indian currency format.

arun
  • 165
  • 1
  • 17