Repository navigation
Description
Background
We're using the list-three.xml file from SIX Group to generate the list of historical currencies. But unlike list-one, this file does not contain the number of minor units of each currency.
Some research work has been done by @survik1 in #104, and the (currency code, minor units) pairs merged in this PR are listed in the table below. On each line, I've also included the number of minor units as reported by a number of data sources and money libraries:
- ISO: this is the latest copy (2013-07-03) on archive.org of the
dl_iso_table_a1.xmlfile from currency-iso.org, which is the file brick/money was using before the official list was transferred to SIX Group. I consider this file the most authoritative of all. - BSI: this is the latest copy (2004-07-02) on archive.org of the
tig90x.docfile from the British Standards Institution. This file is used as reference by SAP (1, 2), so I consider it authoritative as well. - CLDR: the supplementalData.xml seems to be the data used in ICU (and consequently in PHP's
NumberFormatter) for formatting currencies; I think this one is trustable, but currencies with default values (which includesdigits="2") are not listed. - Wikipedia: the ISO 4217 page is not what I would consider a reliable source, but is quite extensive.
- Moneta: the reference implementation for Java's JSR-354 (Java Money).
- Joda: Joda Money is a Java library that predates JSR-354, and I think it's still quite widely used today.
- Noda: Noda Money is a C# library that is inspired by Joda Money, but has its own API and minor unit data.
- Dinero: dinero.js is arguably the most advanced JS money library, with support for many currencies and even support for non-decimal currencies (which is something we'd like to support at some point: see Non decimal currencies are not properly supported #51).
- Ruby: The RubyMoney library.
- Go: The go-money library.
Table
| PR #104 | ISO | BSI | CLDR | Wikipedia | Moneta | Joda | Noda | Dinero | Ruby | Go | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| ADP | 0 | - | 0 | 0 | 0 | 0 | 0 | 0 | - | - | - |
| AFA | 2 | - | 2 | - | 2 | 2 | - | 0 | - | - | - |
| ALK | 2 | - | - | - | - | - | - | - | - | - | - |
| ANG | 2 | 2 | 2 | - | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| AOK | 2 | - | - | - | 0 | - | - | 0 | - | - | - |
| AON | 0 | - | - | - | 0 | - | - | 0 | - | - | - |
| AOR | 0 | - | - | - | 0 | - | - | 0 | - | - | - |
| ARA | 2 | - | - | - | 2 | - | - | 2 | - | - | - |
| ARP | 2 | - | - | - | 2 | - | - | 2 | - | - | - |
| ARY | 2 | - | - | - | - | - | - | 0 | - | - | - |
| ATS | 2 | - | 2 | - | 2 | 2 | 2 | 2 | - | - | - |
| AYM | 2 | - | - | - | - | 2 | - | - | - | - | - |
| AZM | 2 | - | 2 | - | 2 | 2 | - | 0 | - | - | - |
| BAD | 2 | - | - | - | 2 | - | - | 2 | - | - | - |
| BEC | 2 | - | - | - | - | - | - | - | - | - | - |
| BEF | 2 | - | 0 | - | 2 | 0 | 0 | 2 | - | - | - |
| BEL | 2 | - | - | - | - | - | - | - | - | - | - |
| BGJ | 2 | - | - | - | - | - | - | 0 | - | - | - |
| BGK | 2 | - | - | - | - | - | - | 0 | - | - | - |
| BGL | 2 | - | 2 | - | 2 | 2 | - | 2 | - | - | - |
| BGN | 2 | 2 | 2 | - | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| BOP | 2 | - | - | - | 2 | - | - | 2 | - | - | - |
| BRB | 2 | - | - | - | 2 | - | - | 2 | - | - | - |
| BRC | 2 | - | - | - | 2 | - | - | 2 | - | - | - |
| BRE | 2 | - | - | - | 2 | - | - | 2 | - | - | - |
| BRN | 2 | - | - | - | 2 | - | - | 2 | - | - | - |
| BRR | 2 | - | - | - | 2 | - | - | 2 | - | - | - |
| BUK | 2 | - | - | - | - | - | - | 0 | - | - | - |
| BYB | 2 | - | - | - | 2 | 0 | - | 2 | - | - | - |
| BYR | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - | 0 | 0 |
| CHC | 2 | - | - | - | 2 | - | - | - | - | - | - |
| CSD | 2 | - | - | - | 2 | 2 | - | 2 | - | - | - |
| CSJ | 2 | - | - | - | 2 | - | - | 0 | - | - | - |
| CSK | 2 | - | - | - | 2 | - | - | 0 | - | - | - |
| CUC | 2 | 2 | - | - | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| CYP | 3 | - | 2 | - | 2 | 2 | 2 | 2 | - | - | - |
| DDM | 2 | - | - | - | - | - | - | 0 | - | - | - |
| DEM | 2 | - | 2 | - | - | 2 | 2 | 2 | - | - | - |
| ECS | 2 | - | - | - | 0 | - | - | 0 | - | - | - |
| ECV | 2 | - | - | - | 2 | - | - | 0 | - | - | - |
| EEK | 2 | - | 2 | - | 2 | 2 | 2 | 2 | - | 2 | 2 |
| ESA | 2 | - | - | - | - | - | - | 0 | - | - | - |
| ESB | 2 | - | - | - | - | - | - | 0 | - | - | - |
| ESP | 2 | - | 0 | 0 | 0 | 0 | 0 | 0 | - | - | - |
| EUR | 2 | 2 | 2 | - | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| FIM | 2 | - | 2 | - | 2 | 2 | 2 | 2 | - | - | - |
| FRF | 2 | - | 2 | - | 2 | 2 | 2 | 2 | - | - | - |
| GEK | 0 | - | - | - | 0 | - | - | - | - | - | - |
| GHC | 2 | - | 2 | - | 2 | 2 | - | 0 | - | 2 | 2 |
| GHP | 2 | - | - | - | 2 | - | - | - | - | - | - |
| GNE | 2 | - | - | - | - | - | - | 0 | - | - | - |
| GNS | 2 | - | - | - | - | - | - | 0 | - | - | - |
| GQE | 2 | - | - | - | - | - | - | 0 | - | - | - |
| GRD | 2 | - | 0 | - | 0, 2 | 0 | 0 | 2 | - | - | - |
| GWE | 2 | - | - | - | - | - | - | 0 | - | - | - |
| GWP | 2 | - | 2 | - | 2 | 2 | - | 0 | - | - | - |
| HRD | 2 | - | - | - | 2 | - | - | 0 | - | - | - |
| HRK | 2 | 2 | 2 | - | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| IDR | 2 | 2 | 2 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| IEP | 2 | - | 2 | - | 2 | 2 | 2 | 2 | - | - | - |
| ILP | 3 | - | - | - | 3, 2 | - | - | 3 | - | - | - |
| ILR | 2 | - | - | - | 2 | - | - | 2 | - | - | - |
| ISJ | 2 | - | - | - | 2 | - | - | 2 | - | - | - |
| ITL | 2 | - | 0 | 0 | 0 | 0 | 0 | 0 | - | - | - |
| LAJ | 2 | - | - | - | - | - | - | 0 | - | - | - |
| LSM | 2 | - | - | - | - | - | - | 0 | - | - | - |
| LTL | 2 | 2 | 2 | - | 2 | 2 | 2 | 2 | - | 2 | 2 |
| LTT | 2 | - | - | - | 2 | - | - | - | - | - | - |
| LUC | 2 | - | - | - | - | - | - | - | - | - | - |
| LUF | 2 | - | 0 | 0 | 2 | 0 | 0 | 2 | - | - | - |
| LUL | 2 | - | - | - | - | - | - | - | - | - | - |
| LVL | 2 | 2 | 2 | - | 2 | 2 | 2 | 2 | - | 2 | 2 |
| LVR | 2 | - | - | - | 2 | - | - | - | - | - | - |
| MGF | 2 | - | 0 | 0 | 0 | 0 | - | 2 | - | - | - |
| MLF | 2 | - | - | - | - | - | - | 0 | - | - | - |
| MRO | 2 | 2 | 2 | 0 | 2 | 2 | 2 | 1 | - | 1 | - |
| MTL | 3 | - | 2 | - | 2 | 2 | 2 | 2 | - | 2 | - |
| MTP | 2 | - | - | - | - | - | - | 0 | - | - | - |
| MVQ | 2 | - | - | - | - | - | - | 0 | - | - | - |
| MWK | 2 | 2 | 2 | - | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| MXP | 2 | - | - | - | - | - | - | 0 | - | - | - |
| MZE | 2 | - | - | - | 2 | - | - | 0 | - | - | - |
| MZM | 2 | - | 2 | - | 2 | 2 | - | 0 | - | - | - |
| NIC | 2 | - | - | - | 2 | - | - | 0 | - | - | - |
| NLG | 2 | - | 2 | - | 2 | 2 | 2 | 2 | - | - | - |
| PEH | 2 | - | - | - | - | - | - | 0 | - | - | - |
| PEI | 2 | - | - | - | - | - | - | 0 | - | - | - |
| PEN | 2 | 2 | 2 | - | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| PES | 2 | - | - | - | 2 | - | - | - | - | - | - |
| PLZ | 2 | - | - | - | 2 | - | - | 0 | - | - | - |
| PTE | 2 | - | 0 | - | 0 | 0 | 0 | 0 | - | - | - |
| RHD | 2 | - | - | - | 2 | - | - | 0 | - | - | - |
| ROK | 2 | - | - | - | - | - | - | 0 | - | - | - |
| ROL | 2 | - | 2 | - | 0 | 0 | - | 0 | - | - | - |
| RON | 2 | 2 | - | - | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| RUR | 2 | - | 2 | - | 2 | 2 | 2 | 2 | - | - | 2 |
| SDD | 2 | - | 2 | - | 2 | 2 | - | 0 | - | - | - |
| SDG | 2 | 2 | - | - | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| SDP | 2 | - | - | - | - | - | - | 0 | - | - | - |
| SIT | 2 | - | 2 | - | 2 | 2 | 2 | 2 | - | - | - |
| SKK | 2 | - | 2 | - | 2 | 2 | 2 | 2 | - | 2 | 2 |
| SLL | 2 | 2 | 2 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| SRG | 2 | - | 2 | - | 2 | 2 | - | 0 | - | - | - |
| STD | 2 | 2 | 2 | 0 | 2 | 2 | 2 | 2 | - | 2 | 2 |
| SUR | 2 | - | - | - | - | - | - | 0 | - | - | - |
| SZL | 2 | 2 | 2 | - | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| TJR | 2 | - | - | - | 0 | - | - | 0 | - | - | - |
| TMM | 2 | - | 2 | 0 | 2 | 2 | - | 0 | - | 2 | - |
| TPE | 2 | - | 0 | - | 0 | 0 | - | 0 | - | - | - |
| TRL | 2 | - | 0 | 0 | 0 | 0 | - | 0 | - | - | 2 |
| TRY | 2 | 2 | - | - | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| UAK | 2 | - | - | - | 2 | - | - | 0 | - | - | - |
| UGS | 2 | - | - | - | - | - | - | 0 | - | - | - |
| UGW | 2 | - | - | - | - | - | - | 0 | - | - | - |
| USS | 2 | 2 | 2 | - | 2 | 2 | - | 2 | - | - | - |
| UYN | 2 | - | - | - | 2 | - | - | 0 | - | - | - |
| UYP | 2 | - | - | - | - | - | - | 0 | - | - | - |
| VEB | 2 | - | 2 | - | 2 | 2 | - | 2 | - | - | - |
| VEF | 2 | 2 | - | 2 | 2 | 2 | 2 | 2 | - | 2 | 2 |
| VNC | 2 | - | - | - | - | - | - | 2 | - | - | - |
| XEU | - | - | - | - | 0 | - | 0 | 0 | - | - | - |
| XFO | - | - | - | - | - | - | - | 0 | - | - | - |
| XFU | - | - | - | - | - | - | 0 | 0 | - | 2 | - |
| XRE | - | - | - | - | - | - | - | - | - | - | - |
| YDD | 2 | - | - | - | - | - | - | 0 | - | - | - |
| YUD | 2 | - | - | - | 2 | - | - | 2 | - | - | - |
| YUM | 2 | - | 2 | - | 2 | 2 | - | 2 | - | - | - |
| YUN | 2 | - | - | - | 2 | - | - | 2 | - | - | - |
| ZAL | 2 | - | - | - | 2 | - | - | 0 | - | - | - |
| ZMK | 2 | - | 2 | 0 | 2 | 2 | - | 2 | - | 2 | - |
| ZRN | 2 | - | - | - | 2 | - | - | 2 | - | - | - |
| ZRZ | 2 | - | - | - | 2 | - | - | 3 | - | - | - |
| ZWC | 2 | - | - | - | 2 | - | - | 2 | - | - | - |
| ZWD | 2 | - | 2 | 0 | 2 | 2 | - | 2 | - | 2 | 2 |
| ZWL | 2 | 2 | - | - | 2 | 2 | 2 | 2 | 2 | 2 | 2 |
| ZWN | 2 | - | - | - | 2 | 2 | - | 2 | - | 2 | - |
| ZWR | 2 | - | - | - | 2 | 2 | - | 2 | - | 2 | - |
Question
Should we really attempt to obtain potentially erroneous information from untrusted sources (Wikipedia and random websites), or should we stick to the two trusted sources, which probably cover all recently withdrawn currencies (like BGN)?
To put it differently, there are two approaches for the untrusted entries:
- include them anyway, wait for someone to open an issue if wrong
- don't include them, wait for someone to open an issue if missing, citing a reliable source for minor units
I'd lean towards option 2, which is the safest one, and probably covers 99% of the use cases out there anyway.
@survik1, what's your take on this?
Activity
survik1 commentedon Jan 8, 2026
@BenMorel Unfortunately, the sources you have listed do not suffice. As I said in my MR, my goal was to extend minor units to the biggest value it used to have (even though I don't know if it is a correct approach).
For example:
GRD - Used to have minor units, became obsolete over time https://en.wikipedia.org/wiki/Modern_drachma
CYP - Used to have 1/1000 minor unit, replaced with 1/100
TRL - First Turkish lira, hard to get any detailed information, but they did have minor unit of Para ... or at least they had coins of that unit https://cs.ucoin.net/catalog/?country=turkey&period=141
As you can see, these information are in contradiction even with authoritative sources as these sources are using the latest value instead of the max as I have used.
My idea was to ensure that rounding errors wont pop up due to changes over the time, yet this introduces another difference with current existing currencies, as they tend to loose their minor units as well (ISK for example). Maybe it is better to keep the latest value and let users to apply different number of minor units if necessary?
In any way, I would not remove currencies. The possible error from setting the uncertain values to 2 is rather insignificant, as that only allows loose rounding behavior. On contrary, missing currency will lead to critical fail on attempt to create an instance with it.
Note: Currencies starting with X are virtual and can be ignored.
BenMorel commentedon Jan 9, 2026
Thank you for these insights, @survik1.
I updated the issue with data from the CLDR / ICU, plus data extracted from the most popular money libraries in several languages, to get a better view of the landscape.
I'm torn on this one. To analyze your examples:
GRD: Moneta/Joda use0(latest), Noda uses2(max)CYP: Moneta/Joda/Noda agree on2(latest)TRL: Moneta/Noda use0, Go uses2BSI seems to always use the latest one, which seems reasonable to me.
One argument in favour of using the latest one is: if at some point a currency currently in use updated its number of minor units, we would have to update the library with this (breaking) change; then if at a later point the currency were withdrawn, we would archive it with its current value, so the latest one.
I disagree with this one: I think that for a money library, correctness is more valuable than completeness. In my opinion, a few currencies provide most of the value of historical currencies (typically the ones withdrawn in the last couple decades), and we do have archives of official sources for these.
The remaining currencies are much less likely to be used with this library, and if they are, I think one can expect the library to not provide out-of-the-box support for them (and it's easy to create your own
Currencyinstance with whatever minor units suit you). This is the approach used by most money libraries in other languages, so this should not come as a surprise for users.Side note: we could also add support for currencies with "unknown minor units": monies created with such a currency could be initialized with a
CustomContextset to whatever precision was used in the given amount, instead of theDefaultContext. I'm not sure if this feature is of any value though (plus it may violate the principle of least astonishment).Update minor units of historical currencies
BenMorel commentedon Jan 20, 2026
After much thought, I've decided to exclude historical currencies for which we don't yet have sufficient data:
money/import-currencies.php
Lines 309 to 469 in a9fda39
I'll be happy to reintroduce currencies on a case-by-case basis if we find sufficient supporting information.
Anyone is welcome to open an issue or a PR if you need a historical currency that is not yet supported.
I still stand by correctness over completeness, and I think it will be easier to add currencies in the future than to change existing data and break backwards compatibility.
Thanks a lot for your time, @survik1. I understand that you've spent quite some time researching historical currencies, and you'll be more than welcome to share any data sources from your research that I may have missed here!