tippytarka
Programmer
i'm trying to round a figure to two decimal places. the result i get is '2234.6789' and i want the result to look like this...... '2234.68'
here's my code that calculates my total cost and prints to the browser
// CALCULATE total cost
function total_cost($total_base,$total_addtional_selects,$total_vat) {
$price = $total_base + $total_addtional_selects + $total_vat;
return $price;
}
$total_base = purchase_selected_job_titles($licence,$count);
$total_addtional_selects = $tel_value + $email_value;
$total_vat = vat($vat_base,$vat_tel_email);
$final_total_cost = total_cost($total_base,$total_addtional_selects,$total_vat);
print "$final_total_cost";
cheers!
here's my code that calculates my total cost and prints to the browser
// CALCULATE total cost
function total_cost($total_base,$total_addtional_selects,$total_vat) {
$price = $total_base + $total_addtional_selects + $total_vat;
return $price;
}
$total_base = purchase_selected_job_titles($licence,$count);
$total_addtional_selects = $tel_value + $email_value;
$total_vat = vat($vat_base,$vat_tel_email);
$final_total_cost = total_cost($total_base,$total_addtional_selects,$total_vat);
print "$final_total_cost";
cheers!