I am passing some variables to a function to round and add a dollars sign but when the values get into the function they have lost their values.
formatDollars($cost, $taxedCost, $shipping, $total)
function formatDollars($cost, $taxedCost, $shipping, $total) {
$taxedCost = '$'.round($taxedCost, 2);
$shipping = '$'.round($shipping, 2);
$total = '$'.round($total, 2);
$cost = '$'.round($cost, 2);
return array($cost, $taxedCost, $shipping, $total);
}
list($cost, $taxedCost, $shipping, $total) = formatDollars();
When I output I get the dollar signs but all my numbers have become zero.