title: Numbers format of parsed table with simple_html_dom
body: <p>I want to format the content of table cells I am parsing with simple_html_dom. The table exists of words, integers or numbers without dec-points and float values with 2 dec-points. I want them to look like this:</p>
  
  <pre><code>before -&gt; after
  "abc" --&gt; "abc" (can stay as they are)
  "17" --&gt; "17" (can stay as they are)
  "24.24" --&gt; "24.2" (rounded)
  "24.29" --&gt; "24.3" (rounded)
  </code></pre>
  
  <p>I've used this code to format the float values, but integers are formatted to 17.1 in this example. I've tried with <code>!is_integer($td)</code>, but then nothing changes at all.</p>
  
  <pre><code>$table = $html-&gt;find('table', 2);
  $rowData = array();
  
  // Selected Columns
  $columnNumbers = [ 5, 6, 7, 8, 9, 10, 11, 12, 13];
  
  // Loop
  foreach($table-&gt;find('tr') as $row) {
      // initialize array to store the cell data from each row
      $flight = array();
      foreach($row-&gt;find('td') as $columnNumber =&gt; $cell) {
          // push the cell's text to the array
          if ( in_array( $columnNumber, $columnNumbers ) ) {
              $flight[] = $cell-&gt;plaintext;
          }
      }
      foreach($row-&gt;find('th') as $columnNumber =&gt; $cell) {
          // push the cell's text to the array
          if ( in_array( $columnNumber, $columnNumbers ) ) {
              $flight[] = $cell-&gt;plaintext;
          }
      }
      $rowData[] = $flight;
  }
  
  foreach ($rowData as $row =&gt; $tr) {
      echo '&lt;tr&gt;';
      foreach ($tr as $td)
          if (!is_numeric($td)) {
              echo "&lt;td&gt;$td&lt;/td&gt;\n";
          } 
          else {
              echo "&lt;td&gt;".number_format(floatval ($td), 1)."&lt;/td&gt;\n";
          }
      }
      echo '&lt;/tr&gt;';
  }
  </code></pre>