PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
uncorrect results : missed digits (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: uncorrect results : missed digits


#2555
alamshahi (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
uncorrect results : missed digits 3 Years, 8 Months ago Karma: -1  
Dear kksou,

Thanks a million for your great module 'Yahoo Currency Converter'. It works all fine but has a problem in results. there are missed digits. i've checked this issue on your demo page and some other websites which use it (found them here in this forum) and also my website, and it's the same everywhere.

please check the following:
check the results here for CAD to IQD at yahoo finance (which now is 1 CAD = 1045.5946 IQD):
http://finance.yahoo.com/currency-converter#from=CAD;to=IQD;amt=1
and then check the same result in your module (which now shows 1 CAD = 1 IQD)
it misses 3 other digits and all of decimals.

this happens with some currencies which their exchange rate is X=XXX.XXX or X=XXXX.XXX


for example:
check USD to IRR here:
http://finance.yahoo.com/currency-converter#from=USD;to=IRR;amt=1
and compare it with the results of your module.
another example:
check USD to BIF here:
http://finance.yahoo.com/currency-converter#from=USD;to=BIF;amt=1
and again compare with your module's results.

can you please update me with a solution as i really need your module.
 
  The administrator has disabled public write access.

#2560
kksou (Admin)
Admin
Posts: 1678
graph
User Online Now Click here to see the profile of this user
Re:uncorrect results : missed digits 3 Years, 8 Months ago Karma: 27  
Hi,

Thanks for highlighting this - with a lot of details that allow me to pinpoint the error.

The error occurred when Yahoo returns a conversion rate greater than 1,000. The original program was "confused" because of the ',' in 1,000.

Have fixed the bug in the latest version v1.5.4
http://www.kksou.com/php-gtk2/Joomla-Gadgets/Yahoo-Currency-Converter-AJAX-version.php

Note that the page you've given
http://finance.yahoo.com/currency-converter#from=CAD;to=IQD;amt=1
gives a more accurate result with 4 decimal places.

However the above uses AJAX. It's not possible to retreive the value.

The rate the program retrievs is from http://finance.yahoo.com/q?s=CADIQD=X
It only gives up to 1 decimal place.

If you can find a page with a better rate, let me know, and I'll add that in.

Regards,
/kksou
 
 
Last Edit: 2009/08/31 18:58 By kksou.
  The administrator has disabled public write access.

#2561
alamshahi (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Re:uncorrect results : missed digits 3 Years, 8 Months ago Karma: -1  
Dear kksou,

YES! thanks a million! now it gives the correct results!

decimals are not my main interest. as far as i know, yahoo gives the most accurate rates with a wide range of currencies, so I'm not gonna search for another page. but if i stood by any, I'll let you know.

I've installed your new module and when i click convert i get this error on top, but everything works and you get the results:
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /var/www/vhosts/mysite.com/httpdocs/joomla/modules/mod_yahoocurrencyconverter_lib.php on line 219

I've checked mod_yahoocurrencyconverter_lib.php and i came to this:
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
I'm only a designer and my PHP skills are just a little better than what next door barber has. please guide me on how to get rid of this error. if i make it a comment (//) would it be any harm?

Warm regards
A.
 
 
Last Edit: 2009/08/31 23:12 By alamshahi.
  The administrator has disabled public write access.
#2562
kksou (Admin)
Admin
Posts: 1678
graph
User Online Now Click here to see the profile of this user
Re:uncorrect results : missed digits 3 Years, 8 Months ago Karma: 27  
Hi,

Please refer to:
Use which method to retrieve data

Logon as admin, goto Modules Manager and click on "Yahoo Currency Converter". You'll be able to choose which method to retrieve in the first item of the Parameters.

You're using the first method: using cURL.

Select (3) or (2). Don't forget to click Save or Apply and try reload the page again.

Let me know if it works.

Regards,
/kksou
 
  The administrator has disabled public write access.
#2563
alamshahi (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Re:uncorrect results : missed digits 3 Years, 8 Months ago Karma: -1  
Hi again.

Thanks for your support.

I still get the error on Use cURL library and also on Use file_get_contents(). but no error on Use fread() and everything works fine.

I've also checked it with making that line as a comment:
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
and i had no error, and module worked fine.

Thanks again
A.
 
  The administrator has disabled public write access.
#2564
kksou (Admin)
Admin
Posts: 1678
graph
User Online Now Click here to see the profile of this user
Re:uncorrect results : missed digits 3 Years, 8 Months ago Karma: 27  
Hi,

Turned out it's my mistake. Forgot to comment out one line (line 21 of mod_yahoocurrencyconverter_lib.php) Sorry about this...

Please download the file again from:
http://www.kksou.com/php-gtk2/Joomla-Gadgets/Yahoo-Currency-Converter-AJAX-version.php

Should be working now.

Regards,
/kksou
 
 
Last Edit: 2009/09/01 00:00 By kksou.
  The administrator has disabled public write access.
#2565
alamshahi (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Re:uncorrect results : missed digits 3 Years, 8 Months ago Karma: -1  
Yes!
Everything works fine. no error and very accurate results. yummy!

Thanks again
Very few programmers give such after sale care and you are giving it for a free software. keep the good job.

Best Regards
A.
 
  The administrator has disabled public write access.
#2566
dosboy (User)
Fresh Boarder
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
Re:uncorrect results : missed digits 3 Years, 8 Months ago Karma: 0  
I believe the missed digits issue is still occurring. I just grabbed the latest version of the Yahoo Converter (1.5.5) and ran it side by side with the Google Converter. Google seems to be working fine, but the Yahoo is definitely missing digits. Try converting 1 THB to EUR. Google converter reports it as 0.0207 EUR, but the Yahoo one incorrectly reports it as 2.0674 EUR.
 
  The administrator has disabled public write access.
#2567
kksou (Admin)
Admin
Posts: 1678
graph
User Online Now Click here to see the profile of this user
Re:uncorrect results : missed digits 3 Years, 8 Months ago Karma: 27  
Hi,

If you try
http://finance.yahoo.com/currency-converter#from=THB;to=EUR;amt=1

You will get 1 THB about 0.0206 EUR.

However, as noted earlier, this page is an interactive one using AJAX. It's not possible to retrieve the value.

The rate the program retrieves is from
http://finance.yahoo.com/q?s=THBEUR=X

You're right. The rate displayed is wrong. It's displayed as 2.07.

Garbage in, garbage out. The module just displays whatever is returned by Yahoo.

I'm not too sure why Yahoo displays the values *100 - for all figures including Last Trade, Prev Close, Open, etc. Perhaps it's because the rate is too small? So it just multiples by 100? By it should indicate somewhere, isn't it?

Does anybody have any clue?

Regards,
/kksou
 
  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