PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Change number of places after the decimal? (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Change number of places after the decimal?


#5263
asscore (User)
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
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.

#5264
kksou (Admin)
Admin
Posts: 1680
graph
User Online Now Click here to see the profile of this user
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.

#5274
asscore (User)
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
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.



Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Blog - Forum - Privacy Policy - Contact Us
Links - Classes - Social Business - BPM - Web - General
Copyright © 2006-2013. kksou.com. All Rights Reserved