Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- **Potential breaking change**: Fix USDC decimals places from 2 to 6
- Fix typo in ILS currency
- Add Caribbean Guilder (XCG) as replacement for Netherlands Antillean Gulden (ANG)

## 6.19.0

Expand Down
15 changes: 15 additions & 0 deletions config/currency_iso.json
Original file line number Diff line number Diff line change
Expand Up @@ -2557,6 +2557,21 @@
"iso_numeric": "951",
"smallest_denomination": 1
},
"xcg": {
"priority": 100,
"iso_code": "XCG",
"name": "Caribbean Guilder",
"symbol": "Cg",
"alternate_symbols": [],
"subunit": "Cent",
"subunit_to_unit": 100,
"symbol_first": true,
"html_entity": "",
"decimal_mark": ",",
"thousands_separator": ".",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR has , for decimal and . for thousands, but this PR has the opposite. I don't see anything on the linked wikipedia article or a cursory web search to clearly support either of these. Can you explain the formatting choice here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's indeed not a lot documentation available. I have chosen to re-use it from ANG:

"ang": {
"priority": 100,
"iso_code": "ANG",
"name": "Netherlands Antillean Gulden",
"symbol": "ƒ",
"alternate_symbols": ["NAƒ", "NAf", "f"],
"subunit": "Cent",
"subunit_to_unit": 100,
"symbol_first": true,
"html_entity": "ƒ",
"decimal_mark": ",",
"thousands_separator": ".",
"iso_numeric": "532",
"smallest_denomination": 1
},

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, makes sense. Thanks for clarifying!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Caribbean guilder is a special case because it's the official currency for two countries: Sint Maarten and Curaçao. In Sint Maarten they default to English style formatting (e.g. Cg 1,000.00) and in Curaçao they default to European style formatting (e.g. Cg 1.000,00).

An example of localised Cg formatting with Carrefour in Sint Maarten (left) and Curaçao (right):

Carrefour prices in Sint Maarten Carrefour prices in Curaçao

It's probably fine to keep the configuration as is. Out of curiosity I've reached out to their Central Bank to see what they recommend as a default. While the Money (AFAIK) gem doesn't have something out of the box like Intl.NumberFormat that gives the correct format given a locale, one can still configure the formatting for this special currency programatically when working with locales.

"iso_numeric": "532",
"smallest_denomination": 1
},
"xdr": {
"priority": 100,
"iso_code": "XDR",
Expand Down
Loading