Skip to content

How To Put Number Format at Grid Data Column ​

Table : Products ​

Field NameData Type
idint (PK)
namevarchar(255)
pricedouble

Products ​

php
$this->col[] = ["label"=>"Name","name"=>"name"];
$this->col[] = ["label"=>"Price","name"=>"price","callback_php"=>'number_format($row->price)';

or

php
$this->col[] = ["label"=>"Name","name"=>"name"];
$this->col[] = ["label"=>"Price","name"=>"price","callback_php"=>'number_format([price])';

You can see we use callback_php . One think that you need to remember, don't use double quote instead use single quote.

What's Next ​

Table Of Contents ​

Released under the MIT License.