PHP Currency display
I am trying to display a £ sign and commas with in a number to show
currency but i'm not sure how to, here is the code i have that echo's it
as 8999999 instead of £8,999,999
<div id="form">
<form action="index.php" method="post">
<center> <input type="text" name="percent" id="percent" />
<input type="submit" /> </center>
</form>
<center>
<?php
$percent=$_POST['percent'];
$total = 8999999;
/*calculation for discounted price */
$discount_value=$total/100*$percent;
$final_price = $total - $discount_value;
echo $final_price;
?>
</center>
</div>
No comments:
Post a Comment