I noticed the top car on the mileage chart is located in the UK. A gallon in the UK is an imperial gallon, about 1.2x a US gallon. Using an online calculator I found at http://hemsidor.torget.se/users/b/bohjohan...ert/conv2_e.htm his mean mileage comes to about 83 US mpg. Perhaps the database should have some way of adjusting for this, or did I miss mention of this somewhere else?
|
Yes. The database compensates for this. When you enter data, you can select "Imperial Gallons". The value is mathematically calculated and inserted in US gal in the database.
Code:
if ($_POST['mileage_unit2'] == 'liter') { |
Oh, and I don't quite understand your conversion. That should be 83 Imperial gallons, methinks.
|
Ah! Oh, no! I have it backwards!
It should be DIVIDING by 1.2 Great. Guess I better fix this and do some manual calculations to fix the data. |
I'm changing it to the following. I'll change his data so that I'm assuming he used kilometers and Imperial gallons. Is that a good assumption?
To interpret, ignore the $ and $_POST. Between {}s means "Do this". = is to define. == is to see if it's true. Code:
$mileage = $_POST['mileage_integers'].'.'.$_POST['mileage_tenths']; |
Okay. He's back in his rightful place. I didn't change the distances, as I really don't know if he used miles or kilometers. There isn't a significant difference.
I'll need to double check my code for future use. Thank you very much for pointing it out! |
On second thought, I'll probably change it as if he initially put KM because using 7 gallons on a tank isn't normal. The average for insights seems to be about 11.
Ooh! I need to do some heavy thinking tomorrow :( The data is all wrong for him, and I don't want to just delete it. |
Just noticed these issues for myself; passed it on to Jason and he put up the notice to use miles and US Gallons.
For the benefit of those of us using metric: 1.0 litres = 0.264172051 US gallons 1.0 kilometer = 0.621371192 miles Gotta love Google's built-in calculator! Andrew. |
Yes, for now. I'll fix it later today. But, it's really a mind boggler figuring out what to do with the numerator and denominator individually. Eek!
|
...and of course as an added wrinkle we don't actually measure fuel consumption performance in km/L. It's "L/100km"; on Google you can enter in something like:
50 miles per gallon in L/100km ...and get back... 50 miles per gallon = 4.70429169 L/100km Or in my case as an example, my best ever trip I averaged 4.0L/100km on a 600km summer trip (from Ottawa to Kingston and back), average speed of 80km/h: 4.0 L/100km in miles per US gallon ...gives me... 4.0 L/100km = 58.8036461 miles per US gallon So, all that is my long-winded way of saying, until Jason has the time iron out the bugs, those of us using other units can do the calculations via Google. :) Great place you have here, Jason! Andrew. |
All times are GMT -7. The time now is 05:06 PM. |
© 2024 MH Sub I, LLC dba Internet Brands