I have this php code and i want this operations to apear with 2 decimals only. After the php code i'll put an example of what i receive on the output.
$Unir_Destino=$_POST['destino'];
$tons=$_POST['tons'];
$descom=$_POST['descom'];
$remis=$_POST['remis'];
$fact=$_POST['fact'];
mysql_connect("localhost", "user", "password") or die (mysql_error());
mysql_select_db("Destinos") or die (mysql_error());
$Precio= mysql_query("SELECT Precio FROM Destinos WHERE Destino ='$Unir_Destino'");
$Precio1 = mysql_fetch_array($Precio);
$Precio2 = ($Precio1['Precio']);
$Total = $Precio2 * $tons;
$iva = ($Total / 100) * 16;
$totiva = $Total + $iva;
$rete = ($Total / 100) * 4;
$toret = $totiva - $rete;
<span style="font-family: Tahoma;">
<b>Subtotal:</b> <?php print "$$Total <br />";?>
<b>IVA:</b> <?php print "$$iva <br />"; ?>
<b>Subtotal + IVA:</b> <?php print "$$totiva <br />";?>
<b>Retencion:</b> <?php print "$$rete <br />";?>
<b>Total:</b> <?php print "$$toret <br />";?>
</span>
Subtotal: $6297.9 IVA: $1007.664 Subtotal + IVA: $7305.564 Retencion: $251.916 Total: $7053.648