Google Currency Converter - AJAX version

This module allows you to add the Google Currency Converter in a module position.

The module makes use of the Currency Converter from Google Finance. (Scroll to the bottom right and you'll see the Currency Converter.)


Unique Features

  • Performs currency conversion by connecting in real-time at the backend to the Currency Converter from Google Finance. So you get the most up-to-date currency rate as provided by Google Finance.
  • Uses AJAX to display the result - no reloading of pages required!
  • Full CSS support! This means that you can set the font family, font size, foreground and background color of the input field, submit button, etc.
  • The module can be included in a content item! (see below for details)
  • Available for all Joomla versions: Joomla 1.0.x, native 1.5.x, 1.6.x, 1.7.x and 2.5.x!

Complete list of Currencies supported by Google

Note: If your currency is not listed below, you may want to try the Yahoo Currency Converter which provides 62 more currencies than Google. View the additional currencies provided by Yahoo.

  1. AED - United Arab Emirates Dirham (AED)
  2. ANG - Netherlands Antillean Guilder (ANG)
  3. ARS - Argentine Peso (ARS)
  4. AUD - Australian Dollar (AUD)
  5. BDT - Bangladeshi Taka (BDT)
  6. BGN - Bulgarian Lev (BGN)
  7. BHD - Bahraini Dinar (BHD)
  8. BND - Brunei Dollar (BND)
  9. BOB - Bolivian Boliviano (BOB)
  10. BRL - Brazilian Real (BRL)
  11. BWP - Botswanan Pula (BWP)
  12. CAD - Canadian Dollar (CAD)
  13. CHF - Swiss Franc (CHF)
  14. CLP - Chilean Peso (CLP)
  15. CNY - Chinese Yuan (CNY)
  16. COP - Colombian Peso (COP)
  17. CRC - Costa Rican Colon (CRC)
  18. CZK - Czech Republic Koruna (CZK)
  19. DKK - Danish Krone (DKK)
  20. DOP - Dominican Peso (DOP)
  21. DZD - Algerian Dinar (DZD)
  22. EEK - Estonian Kroon (EEK)
  23. EGP - Egyptian Pound (EGP)
  24. EUR - Euro (EUR)
  25. FJD - Fijian Dollar (FJD)
  26. GBP - British Pound Sterling (GBP)
  27. HKD - Hong Kong Dollar (HKD)
  28. HNL - Honduran Lempira (HNL)
  29. HRK - Croatian Kuna (HRK)
  30. HUF - Hungarian Forint (HUF)
  31. IDR - Indonesian Rupiah (IDR)
  32. ILS - Israeli New Sheqel (ILS)
  33. INR - Indian Rupee (INR)
  34. JMD - Jamaican Dollar (JMD)
  35. JOD - Jordanian Dinar (JOD)
  36. JPY - Japanese Yen (JPY)
  37. KES - Kenyan Shilling (KES)
  38. KRW - South Korean Won (KRW)
  39. KWD - Kuwaiti Dinar (KWD)
  40. KYD - Cayman Islands Dollar (KYD)
  41. KZT - Kazakhstani Tenge (KZT)
  42. LBP - Lebanese Pound (LBP)
  43. LKR - Sri Lankan Rupee (LKR)
  44. LTL - Lithuanian Litas (LTL)
  45. LVL - Latvian Lats (LVL)
  46. MAD - Moroccan Dirham (MAD)
  47. MDL - Moldovan Leu (MDL)
  48. MKD - Macedonian Denar (MKD)
  49. MUR - Mauritian Rupee (MUR)
  50. MVR - Maldivian Rufiyaa (MVR)
  51. MXN - Mexican Peso (MXN)
  52. MYR - Malaysian Ringgit (MYR)
  53. NAD - Namibian Dollar (NAD)
  54. NGN - Nigerian Naira (NGN)
  55. NIO - Nicaraguan Cordoba (NIO)
  56. NOK - Norwegian Krone (NOK)
  57. NPR - Nepalese Rupee (NPR)
  58. NZD - New Zealand Dollar (NZD)
  59. OMR - Omani Rial (OMR)
  60. PEN - Peruvian Nuevo Sol (PEN)
  61. PGK - Papua New Guinean Kina (PGK)
  62. PHP - Philippine Peso (PHP)
  63. PKR - Pakistani Rupee (PKR)
  64. PLN - Polish Zloty (PLN)
  65. PYG - Paraguayan Guarani (PYG)
  66. QAR - Qatari Rial (QAR)
  67. RON - Romanian Leu (RON)
  68. RSD - Serbian Dinar (RSD)
  69. RUB - Russian Ruble (RUB)
  70. SAR - Saudi Riyal (SAR)
  71. SCR - Seychellois Rupee (SCR)
  72. SEK - Swedish Krona (SEK)
  73. SGD - Singapore Dollar (SGD)
  74. SKK - Slovak Koruna (SKK)
  75. SLL - Sierra Leonean Leone (SLL)
  76. SVC - Salvadoran Colon (SVC)
  77. THB - Thai Baht (THB)
  78. TND - Tunisian Dinar (TND)
  79. TRY - Turkish Lira (TRY)
  80. TTD - Trinidad and Tobago Dollar (TTD)
  81. TWD - New Taiwan Dollar (TWD)
  82. TZS - Tanzanian Shilling (TZS)
  83. UAH - Ukrainian Hryvnia (UAH)
  84. UGX - Ugandan Shilling (UGX)
  85. USD - US Dollar (USD)
  86. UYU - Uruguayan Peso (UYU)
  87. UZS - Uzbekistan Som (UZS)
  88. VEF - Venezuelan Bolivar (VEF)
  89. VND - Vietnamese Dong (VND)
  90. XOF - CFA Franc BCEAO (XOF)
  91. YER - Yemeni Rial (YER)
  92. ZAR - South African Rand (ZAR)
  93. ZMK - Zambian Kwacha (ZMK)

Note that Google did not release any API for the Google Currency Converter (There are some APIs for Google Finance, but not for the Google Currency Converter).

Latest Version

v1.0.9 (for Joomla 1.0), v1.5.9 (for Joomla 1.5), v1.6.9 (for Joomla 1.6), v1.7.9 (for Joomla 1.7), v2.5.9 (for Joomla 2.5)
Released Apr 6, 2012

Thanks to Pongdej, the latest version can now handle the following 2 cases:

  • 25,000 will now be correctly handled as 25000
  • Any empty spaces after a number will be automatically trimmed and handled correctly

Live Demo

There are four demos available:

Prefer Yahoo Finance?

If you prefer to use the Currency Converter from Yahoo Finance as oppose to Google Finance, here it is:
Yahoo Currency Converter - AJAX version

Including this module in Content Item or Article

Since this is a standard Joomla module, you can easily include this module into a content item or article .

You can take a look at the demo here.

Tips and Techniques

Download


How to install

  1. Download and install the "Google Currency Converter" module.
  2. Make sure the module is published / enabled.
  3. Select a module position where you want to place the module.

That's it! You're now ready to use the Google Currency Converter right inside your Joomla website!

Parameters

You can set the following in the Parameters page:

  1. Use which method to retrieve data: There are now three methods to retrieve data from Google Finance.
    • The default method uses fread().
    • You can also use file_get_contents(). Note that file_get_contents() is only available in PHP5 and above.
    • Use the cURL library. For this method, you need to make sure your PHP has the cURL library installed.

    Use the default method fread() first. If it doesn't work, then try file_get_contents(), and then the cURL library.


  2. Currency From: This is the default "currency from" that will be displayed when the module is first loaded.
  3. Currency To: This is the default "currency to" that will be displayed when the module is first loaded.
  4. Label for Submit Button: Default is "Convert". You may change this to your language.
  5. Use CSS for highlight: When this is set to "No", result will be highlighted in the default yellow background. If you do not not like the default yellow background color and wish to change this to some other color, change this to "Yes". However, when you set this to "Yes", you need to define the color in the .css file of your template. Please see below for details.
  6. Layout style: There are three layout styles to choose from:
  7. Style 1 This one has the minimum width, and is ideal when you are positioning it in the left or right column.
    Goolge Currency Converter - Style 1
    Style 2 This is the same layout as used in Google Finance.
    Goolge Currency Converter - Style 2
    Style 3 This one shows everything in one line. Ideal for use in top or bottom banner-type module position, or in content item.
    Goolge Currency Converter - Style 3

Styling the Module using CSS

You can set the style of every item within the Google Currency Converter to the exact format you want through CSS. This means that you can set the font family, font size, foreground and background color of the input field, pulldown menu, submit button, etc.

For example, if you're using the default Joomla 1.5 template, define the following style in <joomla root folder>/templates/rhuk_milkyway/css/template.css. If you're using the default Joomla 1.0 template, define the following style in <joomla root folder>/templates/rhuk_solarflare_ii/css/template_css.css.

  1. Input Box
  2. div.googlecurrency input.inputbox {
    	font-family: Verdana;
    	font-size: 12pt;
    	font-style: italic;
    }
    
  3. Submit Button
  4. div.googlecurrency input.button {
    	font-family: Verdana;
    	font-size: 10pt;
    }
    
  5. The options of the pulldown menu (i.e. the list of currencies)
  6. div.googlecurrency option {
    	font-family: Verdana;
    	font-size: 10pt;
    }
    
  7. The selected option of the pulldown menu (i.e. the selected currency)
  8. div.googlecurrency select {
    	font-family: Verdana;
    	font-size: 10pt;
    }
    
  9. Input Label (the text "Convert" and "Into")
  10. div.googlecurrency .input_label {
    	font-family: Verdana;
    	font-size: 12pt;
    }
    
  11. The result
  12. div.googlecurrency .result {
    	font-family: Verdana;
    	font-size: 12pt;
    }
    
  13. The highlight for the result. Note: Don't forget to set the "Use CSS" to "Yes" in the Parameters page in order to change the background color of the highliglht.
  14. div.googlecurrency .highlight {
    	color: #333366;
    	background-color: #0033ff;
    }
    
  15. Use this if you wish to set the background color of the entire module block:
  16. div.googlecurrency {
    	background: #33FF66;
    }
    

Version History

  • v1.0.2 (for Joomla 1.0) and v1.5.2 (for Joomla 1.5)
    Released August 28, 2008
  • Bug Fix. When you set the default "currency from" and "currency to", in the parameters page, these options will now be correctly displayed in the frontend. Thanks to Pablo for pointing this out.

  • v1.0.4 (for Joomla 1.0) and v1.5.4 (for Joomla 1.5)
    Released May 6, 2009
  • fixed the undefined variables in mod_googlecurrencyconverter_lib.php
    Notice: Undefined index: process on line 12
    Notice: Undefined index: a on line 21
    Notice: Undefined index: process on line 22
    Notice: Undefined index: use_css on line 44

  • v1.0.5 (for Joomla 1.0) and v1.5.5 (for Joomla 1.5)
    Released May 7, 2009
  • Enable support for css styles for result.

  • v1.0.6 (for Joomla 1.0) and v1.5.6 (for Joomla 1.5)
    Released August 31, 2009
  • Added support for retrieving google currency data using file_get_contents() or fread(). So for those people with no cURL library, you can now use the module using file_get_contents() or fread().

  • v1.0.7 (for Joomla 1.0) and v1.5.7 (for Joomla 1.5)
    Released May 16, 2010
  • This is in response to the Morton's post titled "more than one google converters".

    This new version allows you to display two or more google currency converters all on the same page, each with different currency_from and currency_to.

  • v1.0.8 (for Joomla 1.0), v1.5.8 (for Joomla 1.5), v1.6.8 (for Joomla 1.6) and v1.7.8 (for Joomla 1.7)
    Released Dec 5, 2011
  • v1.0.8 (for Joomla 1.0), v1.5.8 (for Joomla 1.5), v1.6.8 (for Joomla 1.6), v1.7.8 (for Joomla 1.7), v2.5.8 (for Joomla 2.5)
    Released Jan 26, 2012
  • Native version of the Google Currency Converter for Joomla 2.5!