image provider

Currency Converter

The CurrCon Java Applet displays prices on this web page converted with today’s exchange rates into your local international currency, e.g. Euros, US dollars, Canadian dollars, British Pounds, Indian Rupees… CurrCon requires an up-to-date browser and Java version 1.8, preferably 1.8.0_112. If you can’t see the prices in your local currency, Troubleshoot. Use Firefox for best results.


This essay does not describe an existing computer program, just one that should exist. This essay is about a suggested student project in Java programming. This essay gives a rough overview of how it might work. I have no source, object, specifications, file layouts or anything else useful to implementing this project. Everything I have prepared to help you is right here.

This project outline is not like the artificial, tidy little problems you are spoon-fed in school, when all the facts you need are included, nothing extraneous is mentioned, the answer is fully specified, along with hints to nudge you toward a single expected canonical solution. This project is much more like the real world of messy problems where it is up to you to fully the define the end point, or a series of ever more difficult versions of this project and research the information yourself to solve them.

Everything I have to say to help you with this project is written below. I am not prepared to help you implement it; or give you any additional materials. I have too many other projects of my own.

Though I am a programmer by profession, I don’t do people’s homework for them. That just robs them of an education.

You have my full permission to implement this project in any way you please and to keep all the profits from your endeavour.

Please do not email me about this project without reading the disclaimer above.

In many places throughout this website I mention prices in Canadian dollars. These are mostly ball park prices of a variety of things, typically not products I sell. I need to have a way so that people could easily convert that price to their local currency. Ideally the system would remember their preferred currency and automatically display all displayed currencies in that form. They would not need to key in the from-country to-country and amount as they would with a conventional currency converter, such as the one at Oanda.

It would also be sufficient to run some batch process once a week to update my HTML (Hypertext Markup Language) and reupload it. I don’t need up to the second accurate exchange rates.

The programming is fairly simple. It could be done with CGI (Common Gateway Interface), JavaScript or even a Java Applet. The most difficult part is political, getting access to a file of current exchange rates. You could extract it by simulating one of the free converters, or you might make special arrangements with a company such as Oanda to let you periodically download it to your own server using their now defunct FXCommerce service. See the CurrCon manual for other sources.

It might be implemented much the way a hit counter is, using digit *.gifs or a numeric gif to display the value. You might use a cookie to track preferred currency. You might have a way to display/change that preferred currency either as a flag icon or as a country code and/or country name.

Oanda implemented a now defunct scheme very similar to what I have asked for called FXCommerce that requires JavaScript and cookies. A typical convertible price has to be encoded in your HTML with JavaScript like this:

<script type=text/javascript>document.write(OANDAconvert(45.95, USD));</script>
They have recently added some code to hide the script to make this more difficult.

This means the price is $45.95 USD . Unlike mine, Onada is not smart enough to use your local currency as the default display. With Oanda there is no default currency and no display of the current currency country, either in words or icon. In their scheme, typically you use two columns to display, one in US$ and one in local currency that starts out saying Convert This! until the user selects a local currency, which wrecks the layout by being too long a string. In my scheme, you would need only one column.

Here is how you invoke my currency converter I wrote as a Java Applet:

I don’t actually write all the bubblegum, I generate it with an html macro like this:
<!-- macro CurrCon c$A CAD 2500.00 -->
Here is what it looks like on screen: $2500.00 CAD

The interesting thing about is the way all currencies on a page will flip if you change even one. See the gay glossary to see it in action.

Another way to handle this is to prepare your pages with a servlet using JSP (Java Server Pages), or displaying columns of currencies, recalculated daily. You can get a list of the day’s conversion factors by screensrapinig in from their FxDaily page.

You might try a similar but slightly simpler project first, a metric/English measure converter, so you can prepare your web pages in either metric or English units and have the viewer decide in which system they prefer to view the page. The conversions are more complex, but the conversion factors don’t change daily the way currency conversion factors do.

The main cleverness in the program is selecting a suitable unit for a particular dimension, e.g. is inches, feet or yards most appropriate for 59 cm?

The user could even invent her own personal set of measures, e.g. hands where hand is defined as the width of her hand, or strides where a stride is the length of her stride, or fingers for the volume displaced by her index finger up to the knuckle. This lets everyone satisfy Henry VIII-sized egos.

You could even invent a set of personal cooking units of measure, like the pinch and sifterful. You could compose recipes in your personal units and others could read them translated to whatever units they wanted. It would be trivial to add recipe doubling or halving to serve any number of people.

buying CurrCon
CurrCon implementation

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number