There might actually be a currency class somewhere. I know in .NET there is, and I haven't used Java in ages. But I'd look for a localization/internationalization/currency class or package in the Java API. I'm willing to bet that they have something like that. So you wont' have to go through looping through it all yourself.