title: How to format numeric string using C.Gridview - Yii
body: <p>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 </p>
  
  <p>So far I have done this </p>
  
  <pre><code>$this-&gt;widget('zii.widgets.grid.CGridView', array(
  'id'=&gt;'paylist-grid',
  'dataProvider'=&gt;$dataProvider,
  'filter'=&gt;$model,
  'columns'=&gt;array(
  
      'totaldue'=&gt; array(
          'value'=&gt;'totaldue',         
          'type'=&gt;'number'),
  // more code ... 
  </code></pre>
  
  <p>This would work if total due was a int or double, but because it is a string, I am getting thrown an error.</p>
  
  <p>I attempted to change number into an int by using intval 
  ex. </p>
  
  <pre><code>'totaldue'=&gt; array(
          'value'=&gt;intval('totaldue'),          
          'type'=&gt;'number'),
  // more code ... 
  </code></pre>
  
  <p>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!</p>