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.