Hello,
If I have an array which outputs a product sale price (newcost) after adding a percentage to the product's cost in the database. Which ends up creating a price of something like $452.3296. How can I format the array's output to two decimal positions.
Here is parts of the query code:
$charge = (1+ ($percent/100));
query="select...cost*$charge as newcost where....";
echo this: .$row[newcost]
I can use number_format on $charge, but that won't format it when it gets multiplied by the cost. newcost is what needs to be formated - can I do that to the echo ouput above?
If I have an array which outputs a product sale price (newcost) after adding a percentage to the product's cost in the database. Which ends up creating a price of something like $452.3296. How can I format the array's output to two decimal positions.
Here is parts of the query code:
$charge = (1+ ($percent/100));
query="select...cost*$charge as newcost where....";
echo this: .$row[newcost]
I can use number_format on $charge, but that won't format it when it gets multiplied by the cost. newcost is what needs to be formated - can I do that to the echo ouput above?