I have a mysql recordset that includes
'price_prd ' (item price - eg 14.95)
'amount_tax' (tax percentage to add - eg 17.5)
how can I show/ echo
<?php echo $row_rsPrd['price_prd']; ?> x 1.<?php echo $row_rsPrd[amount_tax]; ?>
price x 1.tax
...with only 2 deimal places?
much appreciated if anyone has the solution!
Have a look at PHP's built in function number_format :
basic php math:
$price = $row_rsPrd['price_prd'];
$tax = $row_rsPrd[amount_tax];
$total = $price * $tax;
Format $total by using number (or money) format function that was mentioned in the previous post.
Europe, Middle East and Africa