I've recently run into the issue where I have a string of numbers (totaldue) that I would like to format in my C.Gridview so that 10000 would become 10,000
So far I have done this
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'paylist-grid',
'dataProvider'=>$dataProvider,
'filter'=>$model,
'columns'=>array(
'totaldue'=> array(
'value'=>'totaldue',
'type'=>'number'),
// more code ...
This would work if total due was a int or double, but because it is a string, I am getting thrown an error.
I attempted to change number into an int by using intval ex.
'totaldue'=> array(
'value'=>intval('totaldue'),
'type'=>'number'),
// more code ...
but this threw back the error call_user_func_array() expects parameter 1 to be a valid callback, no array or string given. I know that this can be done - but I'm struggling to implement it. Any advice/help would be greatly appreciated!
try