0

I'm currently creating a website with django 1.8 and I've met a detail, I must display a price list in the local currency of the country in which it is displayed but do not know how to convert between prices (eg, equivalence between the price in USD and EUR) Please could someone help me.

Thank You.

Josseline Perdomo
  • 363
  • 1
  • 4
  • 15

1 Answers1

0

As others have said, currency conversion can be dangerous as the currency market is volatile and constantly changing. In order to do what you want, you'll need a few things:

  • An IP based geolocation service to determine what currency they might be used to. These are unreliable at best, and it might not even be the currency your user wants. There are lots of these services, ranging from cheap to "only Fortune 500 companies can afford these". Do your research and figure out what is best for you. Most don't even work for IPv6, so you'll have a hole there.
  • A currency conversion API. See this StackOverflow answer. Perhaps slightly more reliable than IP geolocation services, but still should be considered unreliable.

You probably want to be very clear and warn your users that the conversion rates are estimates. There should be a very big asterisk and warning next to every estimated currency conversion if you do this at all.

If you're taking payments, take them in whatever currency you want, and their bank will do the final conversion.

Generally, what you want to do is a bad idea from just about every angle.

Community
  • 1
  • 1
Brett Gmoser
  • 1,702
  • 1
  • 12
  • 19