The challenges of formatting currency data

Localization and internationalization of an app or site it’s a challenge that’s not specially hard on the technical side, but that it can ceirtanly become difficult for social and behavioral aspects, such as our own etnocentrism, lack of standardized standards, or even standards that conflict with actual use or user expectations.

The development team at Etsy identified three attributes that affected currency formatting: the currency, user location and user language. Their post on How Etsy Formats Currency shows how to correctly format currency and some of the practical decisions that are involved in the process.

The greatest countries and administrative subdivisions database ever

The United Nations Code for Trade and Transport Locations it’s probably the greatest countries, states, regions, cities and localities database you can ever find; or at least the most complete you might hope for. It includes over 100,000 locations in 249 countries with detailed administrative subdivisions info and even geographic coordinates (rough, but still).

The most complete localization data you’ll ever need

The Unicode Common Locale Data Repository it’s “the largest and most extensive repository of locale data available”, so it’s pretty much the perfect solution when you need information such as:

  • Currency values, with ISO codes and visualization formats
  • Dates and times patterns, including timezones
  • List of “territories”, countries, continents, etc. with their corresponding languages, currencies
  • Translations of all of the above

You can get their data from their Downloads page in XML format (follow the links in the Data column) or, if you prefer JSON, you may the Releases on their GitHub repository.

The JSON data it’s also available for use with NPM or bower.