amachado
amachado

Reputation: 1040

Currency Symbol for a given currency code

I'm trying to output all currency symbol (like $ or €) in java for a given currency code. The list of currency codes can be found in http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml and the language is either "pt" or "en".

I tried already many solutions found over the internet, but some print only € other prints the currency code... but I did not found solution to print all the currency symbol in that list.

Someone can help on that?

Thanks

Upvotes: 1

Views: 1000

Answers (1)

John Humphreys
John Humphreys

Reputation: 39264

I think you're looking for a list like this: http://www.xe.com/symbols.php

Just read in the list and create a map of columns 1 = key, 3 = value. Most of the currency symbols are single-character, but not all are. That's just a fact of life.

Using the code, you can go between the symbol in this new list and the currency value in the original source you provided.

Upvotes: 1

Related Questions