How would I convert this so that the result has a decimal for dollar amount.
Right now it is this :
6x.01+1.00=7
I want it so that it is like this :
6x.01+1.00=$7.00
<?
if($_POST) // see if user submitted it //
{
$fee="1.00";
// multoply them together plus fee//
$retval=$_POST['val1'] * $_POST['val2'] + $fee;
}
?>
<form action="<?=$PHP_SELF?>" method="post">
<?
$result=(isset($retval))?$retval:"";
$v1=(isset($_POST['val1'])?$_POST['val1']:"");
if(isset($_POST['val2'])){
$v2=$_POST['val2'];
}else{
$v2="";
}
?>
input 1: <input type=text name=val1 value="<?=$v1?>" size=10><br>
input 2: <input type=text name=val2 value="<?=$v2?>" size=10><br>
Fee: $<?=$fee?><br>
<input type=hidden name=fee value="<?=$fee?>"><br>
Total In Dollar Amount: [ $ <b><?=$result?></b> ]<br>
<input type=hidden name=result value="<?=$result?>"><br>
<input type=submit value=" Calculate ">
</form>