title: Hiding the decimal if .0 and showing zero if an integer
body: <p>I have two, hopefully basic number questions.</p>
  
  <p>First, I am using the decimal data type on MySQL to show data like speed or height set to one decimal place like this <code>decimal(4,1)</code> My problem is that for numbers with no dp it is still showing .0 - What I get is '309.0' but what I want is '309'. What do I need to change to hide the '.0'?</p>
  
  <p>Second I have an integer data type showing fixed numbers. Many of the numbers are 0 zero but these are getting treated as null and not displaying. How do I force the 0's to display? (I can't make table changes for this because other columns do have zero's that are null values. It is only this one column that needs zeros to display).</p>
  
  <p>For both of these problems PHP is being used to display the results.</p>
  
  <p>EDIT: code I'm using to display results. the top one needs to not show .0 the bottom one needs to show a zero.</p>
  
  <pre><code>Length:&lt;/b&gt; %sft' . PHP_EOL, $row2['length'])
  
  Inversions:&lt;/b&gt; %s' . PHP_EOL, $row2['inversions'])
  </code></pre>