Fuel Economy & Emissions Talk about the mileage database, EPA, hypermiling, gas and driving strategy.

Imperial gallons?

Thread Tools
 
Search this Thread
 
  #1  
Old 05-17-2004, 07:53 PM
3cyl's Avatar
Enthusiast
Thread Starter
Join Date: May 2004
Posts: 2
Default

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?
 
  #2  
Old 05-17-2004, 07:57 PM
Jason's Avatar
Site Founder
Join Date: Dec 2003
Posts: 4,623
Default

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') {
 	$mileage = $mileage*3.785;
 } elseif ($_POST['mileage_unit2'] == 'imperialgallon') {
 	$mileage = $mileage*1.201;
 }
There's some computer code for you. Basically says that if they select "liter", multiply by 3.785. If "imperial gallon", by 1.201.
 
  #3  
Old 05-17-2004, 08:00 PM
Jason's Avatar
Site Founder
Join Date: Dec 2003
Posts: 4,623
Default

Oh, and I don't quite understand your conversion. That should be 83 Imperial gallons, methinks.
 
  #4  
Old 05-17-2004, 08:02 PM
Jason's Avatar
Site Founder
Join Date: Dec 2003
Posts: 4,623
Default

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.
 
  #5  
Old 05-17-2004, 08:12 PM
Jason's Avatar
Site Founder
Join Date: Dec 2003
Posts: 4,623
Default

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'];
 if ($_POST['mileage_unit1'] == 'km') {
 	$mileage = $mileage*1.609;
 }
 if ($_POST['mileage_unit2'] == 'liter') {
 	$mileage = $mileage*3.785;
 } elseif ($_POST['mileage_unit2'] == 'imperialgallon') {
 	$mileage = $mileage/1.201;
 }
 $mileage = round($mileage,1);
 
 if ($_POST['distance_unit'] == 'km') {
 	$distance = round($_POST['distance']*1.609);
 } else {
 	$distance = $_POST['distance'];
 }
 
  #6  
Old 05-17-2004, 08:20 PM
Jason's Avatar
Site Founder
Join Date: Dec 2003
Posts: 4,623
Default

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!
 
  #7  
Old 05-17-2004, 08:27 PM
Jason's Avatar
Site Founder
Join Date: Dec 2003
Posts: 4,623
Default

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.
 
  #8  
Old 05-21-2004, 07:13 AM
aplumb's Avatar
Enthusiast
Join Date: May 2004
Location: Ottawa, Ontario, Canada
Posts: 2
Default

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.
 
  #9  
Old 05-21-2004, 07:14 AM
Jason's Avatar
Site Founder
Join Date: Dec 2003
Posts: 4,623
Default

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!
 
  #10  
Old 05-21-2004, 08:06 AM
aplumb's Avatar
Enthusiast
Join Date: May 2004
Location: Ottawa, Ontario, Canada
Posts: 2
Default

...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.
 


Quick Reply: Imperial gallons?


Contact Us -

  • Manage Preferences
  • Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service - Your Privacy Choices -

    When you click on links to various merchants on this site and make a purchase, this can result in this site earning a commission. Affiliate programs and affiliations include, but are not limited to, the eBay Partner Network.

    © 2024 MH Sub I, LLC dba Internet Brands


    All times are GMT -7. The time now is 11:25 PM.