Remove trailing zeros until 2 decimals in PHP
<p>I've tried casting to <code>float</code> and <code>number_format</code> but float will always round at two and number_format is fixed on the amount of decimals you specify.</p>

<p>So how can I do this like the following conversion</p>

<pre><code>11.2200 -&gt; 11.22
11.2000 -&gt; 11.20
11.2340 -&gt; 11.234
</code></pre>