Conditional formatting of a float in PHP
<p>I'm retrieving a float value from a mysql database on a php page (2.5, 3.0 etc)</p>

<p>I would like to format this value so that if it is actually an integer, it should show zero decimal places. (it should output 3 instead of 3.0, but output 2.5 as 2.5)</p>

<p>What would be the simplest way to achieve this?</p>
