PHP number format 2 decimal places
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/6308687/php-number-format">PHP number format</a>  </p>
</blockquote>



<p>The following code out puts a figure for shipping cost based on a currency conversion that happens elsehwere, but it outputs with many decimal places. Can I alter something here that will produce a number with just 2 decimal places?</p>

<pre><code>if(isset($_POST['ShippingMethod'])){
            $order['data']  .= "\r\n ========== Shipping Cost ========== \r\n\r";
            $order['data'] .="\r\n Shipping Method Cost: ". $_SESSION['currency_symbol'].$_POST['ShippingMethod']. " \r\n";
            $form['price']['shipping'] +=$_POST['ShippingMethod'];
    }   
</code></pre>
