This is in response to asscore's question - How to change number of places after the decimal for the Google Currency Converter module.
By default, Google returns the converted currency in 4 decimal places. To change to 2 decimal places, all we need to do is to grab the value of the converted currency and use the standard PHP number_format()
function to format it to 2 decimal places.
Solution
- Goto the folder:
<Joomla_Root_Folder>/modules/mod_googlecurrencyconverter
- Edit the file:
mod_googlecurrencyconverter_lib.php
- Goto line 52. You should see:
- Add one more line after this:
- Don't forget to save the file.
$data = $app->process();
The variable $data
contains the value of the converted currency.
$data = number_format($data, 2);
This will format the output to 2 decimal places.
Read more...