Re:Change number of places after the decimal? (1 viewing) (1) Guest
Favoured: 0
|
|
|
TOPIC: Re:Change number of places after the decimal?
|
asscore (User)
Fresh Boarder
Posts: 2
|
|
Change number of places after the decimal? 1 Year ago
|
Karma: 0
|
|
Hello.
By default the google currency converter displays 4 places after the decimal (ten-thousanths).
How could I hack the module so that it only displayed to hundreths? (two places after the decimal).
so instead of
1 USD = 7.7265 ZAR
I would get
1 USD = 7.72 ZAR
Thanks!
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
kksou (Admin)
Admin
Posts: 1680
|
|
Re:Change number of places after the decimal? 1 Year ago
|
Karma: 27
|
|
Hi,
1) Goto the folder: <Joomla_Root_Folder>/modules/mod_googlecurrencyconverter
2) Edit the file: mod_googlecurrencyconverter_lib.php
3) Goto line 52. You should see: $data = $app->process();
The variable $data contains the value of the converted currency.
4) Add one more line after this:
$data = number_format($data, 2);
This will format the output to 2 decimal places.
Don't forget to save the file.
Let me know if this works for you, ok?
Regards,
/kksou
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
asscore (User)
Fresh Boarder
Posts: 2
|
|
Re:Change number of places after the decimal? 1 Year ago
|
Karma: 0
|
|
Hi Kksou,
That did the trick! Thanks for your help.
Regards,
|
|
|
|
|
|
|
The administrator has disabled public write access.
|
|
|
|
|