if ($total == 0) { $total = "Error"; } else { $total = sprintf("%0.2f", $total); }