title: How to get the number in string format for json format?
body: <p>I write this code to output as json format for google chart. however, the return value for number become a string and can't be read by google chart.</p>
  
  <pre><code>$rows = array();
  foreach($data as $item) {
  $a = new stdClass;
  $a-&gt;v = $item-&gt;location_name;
  $a-&gt;f = null;
  
  $b = new stdClass;
  $b-&gt;v = $item-&gt;count;
  $b-&gt;f = null;
  
  $c = new stdClass;
  $c-&gt;c = array($a, $b);
  
  $rows[] = $c;
  
  }
  $cols1 = new stdClass;
  $cols1-&gt;id = '';
  $cols1-&gt;label = 'STATE';
  $cols1-&gt;pattern = '';
  $cols1-&gt;type = "string";
  
  $cols2 = new stdClass;
  $cols2-&gt;id = '';
  $cols2-&gt;label = 'TOTAL';
  $cols2-&gt;pattern = '';
  $cols2-&gt;type = "number";
  
  $returndata = new stdClass;
  $returndata-&gt;cols = array($cols1, $cols2);
  $returndata-&gt;rows = $rows;
  
  echo json_encode($returndata);
  </code></pre>
  
  <p>the output become like this:
  <a href="https://i.stack.imgur.com/3Xdil.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3Xdil.jpg" alt="the number should not be in string format"></a></p>
  
  <p>the query is like this:</p>
  
  <pre><code>$sql = "Select ljl.location_id, count(ljj.job_id) as count, ljl.location_name from {local_jobs_job} ljj inner join {local_jobs_location} ljl on ljj.job_location = ljl.location_id group by ljl.location_name";
  </code></pre>