Archive for June, 2006
Currency Conversion
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:
http://ontariogasprices.com/
http://michigangasprices.com
http://finance.yahoo.com
as soon as all of the data was retreived (gas prices used a php web scraping library, currency data from Yahoo! Finance retrieved similarly to how Exch does), do the math, and it would let me know who was paying what for gas prices… well using a little Google search, most of the logic of this script became a lot easier (well it has been for some time, but I thought I would share on this little known secret :-)… for example Google these searches below:
3.16 USD per gallon in CAD per liter
3.16 (U.S. dollars per US gallon) = 0.945976868 Canadian dollars per liter
1.10 CAD per litre in USD per gallon
1.10 (Canadian dollars per litre) = 3.67450845 U.S. dollars per US gallon
1.10 CAD per litre in EUR per gallon
1.10 (Canadian dollars per litre) = 2.90268461 Euros per US gallon
1.10 CAD per litre in EUR per litre
1.10 (Canadian dollars per litre) = 0.766808149 Euros per litre
Google even acknowledges the alternative spellings of “liter/litre” … nice huh?