Tuesday, March 06, 2007

Automatic currency conversion

A few days ago, Plimus contacted me to let me know they solved the fixed currency problem. I was glad that I could finally put a price in US$ next to Euros on my website. So Sunday afternoon, I started to make some changes.

But then I realized something. How much do I charge my US customers? I could use the current exchange rate and set it at a round number close to it which seemed the honest thing to do. But it would result in rather odd amounts (e.g. $32.00). Another option was to change that amount to the next nice looking number (being $30.00 or $35.00), but that didn't seem fair. So I started thinking. Would it be possible to put a US$ amount that reflects the current exchange rate on my website?

As with all questions in life, Google is THE way to find the answer. I found yourcurrencyconverter which seemed to offer everything I wanted. They check the visitor IP and scan your page for currencies. Then they adjust the currency text to fit the visitor’s currency. I signed up and created a test page with the system. Everything seemed to work fine, and I was glad to have a solution for my problem. Of course, they do show their ad on your page, but for US $49.95 each year, the ad is removed.

But I'm a programmer. So I wondered how hard it would be to create my own system. Not that the US $49.95 would be a problem, but I'm a control freak and I'd feel more comfortable if I have my own system. Also, what happens if their site is down? So I made a deal: if I can make something like this in 1 day, then I'll create it and use my own system. Otherwise, I'll use theirs.

Again, Google in al its greatness found me the stuff I needed to implement it myself. I don't know PHP that well, but it seemed easy enough to figure things out. And after 6 hours, I had my own system up and running. Not all currencies are working right now, but every currency I have dealt with before is (US$, CA$, AUS$, Yen, Euro, GBP, Scandinavian Kronor, ...). So that will be sufficient for now. It's still on my test page at the moment, but I will put it on all my pages in a few days if all works well.

People using Euro will see:

While people from Australia will see:

I guess developers are the worst people to try to sell your software to. If they can make it themselves with a little effort, they will. I hope this solves all my currency issues I’ve had the past few weeks.