Ticket #186 (assigned defect)

Opened 10 months ago

Last modified 6 months ago

The currency list evaluation some currencies to zero (0)

Reported by: asiby Assigned to: stavros (accepted)
Priority: major Milestone: milestone Version 1.3
Component: General Version: Stable 1.3.2 (Yellowjacket)
Keywords: currency list Cc:

Description

Some currencies are evaluated to zero. We are not using USD as base currency, and USD just happen to be worth 0 in the currency list. As a result, the balance or the accounts that use USD as currency will be announced a 0 even when the account is not 0.

Seeing this, we have immediately checked the currency conversion found on Yahoo Finances and it is giving the correct values. So the glitch seems to be in A2Billing.

Change History

05/07/08 02:14:11 changed by areski

Hello Asiby,

News about this issue ? Did you find what was going going wrong ?

Rgds, Areski

06/02/08 15:29:14 changed by stavros

  • owner changed from areski to stavros.
  • status changed from new to assigned.

Asiby, I may possibly have fixed this issue with the recent work I did on the currencies update code. Would you mind testing again please?

This is the first time I've seen this ticket, or I would have commented sooner. Sorry about that.

(follow-up: ↓ 4 ) 06/02/08 15:46:24 changed by asiby

Yes Stavros. This problem has been fixed now. I have seen that instead of zero, a2billing sets them at 0.00001

Having seen that, I was wondering if A2Billing could optionally disallow some currencies cause I wouldn't want my customers to use an exchange rate that I know is wrong.

The real issue is from Yahoo!. I hope that they are not doing this for a political reason, but the rates for some specific countries are set to 0 on yahoo. What a shame.

The best currency exchange tool that I know so far is XE.com but unfortunately, they charge 500$ per year to have access to their Web API.

Thanks for your support.

(in reply to: ↑ 3 ) 06/02/08 20:30:41 changed by stavros

Replying to asiby:

Yes Stavros. This problem has been fixed now. I have seen that instead of zero, a2billing sets them at 0.00001 The real issue is from Yahoo!. I hope that they are not doing this for a political reason, but the rates for some specific countries are set to 0 on yahoo. What a shame.

What base currency are you using? Yahoo were rounding to 4DPs at some odd times during their currency conversion. Can this be explained by the relative strength of your base_currency and/or the 0 currencies being greater than 4 orders of magnitude from XAG (ounces of silver) which we now use as the base for transactions with Yahoo? We might need to get smarter again in how we deal with Yahoo, or switch to a commercial source as you suggest.

Having seen that, I was wondering if A2Billing could optionally disallow some currencies cause I wouldn't want my customers to use an exchange rate that I know is wrong.

Unless I'm mistaken aren't all calculations handled in base_currency anyway, so this is only really a display time glitch?

The best currency exchange tool that I know so far is XE.com but unfortunately, they charge 500$ per year to have access to their Web API.

I asked http://xurrency.com/ for their rates for commercial use, but they never got back to me. I just sent another message.

A little more information from an email from me to Areski when I was working on these changes:

I've tried to verify its accuracy by chosing three widely different values of currency, and calculating their ratios. I then changed base_currency to something with a drastically different value, updated, and recalculated the ratios of the same three currencies. The ratios agree to 6 decimal places. I'm no mathematician, but I think this is a pretty good indication things are correct. The reciprocal test I tried originally, which uncovered these inaccuracies, now gives /exactly/ the same figures both ways, at least for the currencies I chose.

06/02/08 23:40:00 changed by asiby

Stavros, the base currency has not much to do with this error. I have tested this outside A2Billing. Here are the links:

Xe.com : http://www.xe.com/ucc/full/

Yahoo Finance: http://ca.finance.yahoo.com/currency/convert?amt=1&from=USD&to=LYD&submit=Convert

Use these 2 links to convert from 1 USD to LYD (Libyan Dinar)

The correct result is supposed to be roughly 1 USD = 1.18950 LYD

You can reproduce the same false rates in Yahoo for all the rates that used to be 0 in a2billing (they are now 0.00001). Yet, all other currency conversion sites and local banks give the correct exchange rates.

Yahoo! is not doing something right.



Google