Skip to main content
Inspiring
June 16, 2011
Question

Convert geolocation to local currency.

  • June 16, 2011
  • 1 reply
  • 877 views

Can somebody recommend an easy way to convert location coordinates (latitude and longitude) returned by geolocation into name of the local currency?

Example:

GetLocalCurrencyFromLocation(34, -111) returns "USD"

Thank you.

This topic has been closed for replies.

1 reply

Participating Frequently
June 16, 2011

Hello,

wait: get currency format from coordinates? Do you mean kind of *reverse geolocation"? (Q: knowing lat/long what is currency format used on nearest *point of interest*?) (if you get reversed geolocation data like zip code/country code you would certainly have some options to get local currency).

thanks,

Peter

Inspiring
June 17, 2011

At the very least I would need to convert from lat/long to country. Conversion from country to currency name should be easy.

My question is can I use some existing function for that without "reinventing the wheel" or using a web service that would require Internet access.

Colin Holgate
Inspiring
June 17, 2011

Might it not be better to convert the device's IP number to the country it's in? Then you could know the currency too. Look at this page that discusses the problem:

http://www.1keydata.com/blog/2006/09/convert-ip-address-to-country.html

That article is all about Perl, but it has links through to where there is a CSV file of all the IP numbers, and the country they are in. I downloaded the file, it's about 900k. You could reduce that a lot by just taking the first number (the start of range) and make your own column for the currency. that should get it down to about 200k.

Of course, you would at some point need to be online to know the IP number, but if the user had managed to get the app installed, and as you often would do, tried the app, they are certainly online right then!