echo "
If you use US Gallons, the calclations will be incorrect. If you would like this"; echo " feature to allow the option of US Gallons, please mail me and I will add that option. However, the "Pence Per Litre" option should work for all decimal (xx.xx) currencies."; "; if (isset($_POST["calc"])) { echo "
| Litres | " . $_POST["litres"] . " |
|---|---|
| Gallons | %0.2f |
| MPG | %0.2f |
%0.2f miles fuelled by %0.2f litres equates to %0.2f MPG
", $_POST["miles"], $_POST["litres"], $mpg); $cost = $_POST["ppl"] * $_POST["litres"] / $_POST["miles"]; printf("Cost per Mile at %0.2f pence per litre = %0.2f pence per mile
", $_POST["ppl"], $cost); } echo "