duckduckgo / zeroclickinfo-spice

DuckDuckGo Instant Answers based on JavaScript (JSON) APIs
https://duckduckhack.com/
Other
548 stars 942 forks source link

Currency Conversion: #3361

Closed Michal-Sitarz closed 7 years ago

Michal-Sitarz commented 7 years ago

NZD to GBP doesn't work right... It shows (at the time I was checking it) 1 to 0.56 (NZD to GBP) , but it converts by 1 to 1.77, since I'll start typing the digits... GBP to NZD works OK, and this is 1 to 1.77...

Conclusion: it looks like formula for NZD to GBP is the same as GBP to NZD... cause the source: XE.com shows everything OK.


IA Page: http://duck.co/ia/view/currency Maintainer: @MrChrisW

kirkins commented 7 years ago

@Michal-Sitarz Can you clarify the issue here?

I converted NZD to GBP and vise-versa, both times the results matched that of Google.

Michal-Sitarz commented 7 years ago

I've done it right now and 50000 NZD gives me 88522 GBPP https://duckduckgo.com/?q=nzd+to+gbp&t=h_&ia=currency

kirkins commented 7 years ago

I don't get that can you post a link and screenshot: untitled

https://duckduckgo.com/?q=50000+NZD+to+gbp&t=h_&ia=currency

Michal-Sitarz commented 7 years ago

duckduckgo-nzd-to-gbp

Michal-Sitarz commented 7 years ago

Checked in Firefox and Chrome - both with the same result, as above...

kirkins commented 7 years ago

@Michal-Sitarz I see what you mean now. It works when you do a search query but there is an issue with the interactive part.

Michal-Sitarz commented 7 years ago

Yes, when you try to increase/decrease the value, it will be wrong...

Michal-Sitarz commented 7 years ago

Looks like it uses same formula as for GBP to NZD (reverse conversion).

kirkins commented 7 years ago

@Michal-Sitarz I'm wondering if a recent pull request fixed the issue because I can't replicate the bug on the beta server: https://beta.duckduckgo.com/?q=NZD+to+GBP&t=h_&ia=currency

kirkins commented 7 years ago

Edit: accidentally linked non-beta version. Link updated.

Michal-Sitarz commented 7 years ago

Yes, on beta version (using above link) it works OK.

// I've noticed that you had some issues with reverse-conversion, cause it looked like that. // Thanks for super-fast reply for this issue :)

pjhampton commented 7 years ago

Thanks @Michal-Sitarz and @kirkins!

We're aware of this issue and have a fix ready to go. For some context, DuckDuckGo have some special internal triggering modules that they can attach to IAs. This type of triggering is making an additional api call that is overriding the logic in the IA - making the exchange rate the inverse rate. I didn't take us that long to get to the bottom of this, but we didn't do a release on Friday so that's why this persists. Hopefully, we can get it out today! I'm going to close this because of https://github.com/duckduckgo/zeroclickinfo-spice/issues/3356

edit: Also, we don't use the special triggering on beta, that's why it works just fine there.