Currency Conversion
Monday, 26 June 2006
A long time ago, I wrote a PHP script to compare current gas prices from Michigan and Ontario in current US and Canadian dollar rates from the following three sites:
…as soon as all of the data was gathered (gas prices were fetched using a PHP scraping library, currency data from Yahoo! Finance was retrieved similarly to how Exch does), and after the math was taken care of, it would let me know who was paying what for gas prices. The above really isn’t necessary any longer as you can use a little Google search instead. It has been available for some time, but seems like a little known secret, so I figured I would share.
For example Google these searches below:
Search: “3.16 USD per gallon in CAD per liter”
Current Result: 3.16 (U.S. dollars per US gallon) = 0.945976868 Canadian dollars per liter
Search: “1.10 CAD per litre in USD per gallon”
Current Result: 1.10 (Canadian dollars per litre) = 3.67450845 U.S. dollars per US gallon
Search: “1.10 CAD per litre in EUR per gallon”
Current Result: 1.10 (Canadian dollars per litre) = 2.90268461 Euros per US gallon
Search: “1.10 CAD per litre in EUR per litre”
Current Result: 1.10 (Canadian dollars per litre) = 0.766808149 Euros per litre
Google even acknowledges the alternative spellings of “liter/litre” … nice huh?