Closed mboudraa closed 11 months ago
That does sound useful.
We have the data available in https://github.com/unicode-org/cldr-json/blob/main/cldr-json/cldr-core/supplemental/currencyData.json, we could parse it into a currencyCountries / countryCurrencies of type map[string][string] that maps country codes to currency codes.
Yes that would be great. Also at the risk of being to demanding 😅, Having the ability to have the currency full name would be also extremely useful for building drop downs of available currencies for selection for example
we could parse it into a currencyCountries / countryCurrencies of type map[string][string] that maps country codes to currency codes.
yes I build a local map of country to currency map[string]string that would allow me to do something like
currencyCode := countryCurrency["CA"]
digits, err := currency.GetDigits(countryCode)
Not having to maintain that map would be fantastic.
If I can help in any way, let me know
Having the ability to have the currency full name would be also extremely useful for building drop downs of available currencies for selection for example
This is covered in the README:
Currency names are not included because they are rarely shown, but need significant space. Instead, they can be fetched on the frontend via Intl.DisplayNames.
It would be very useful to expose a function like
it would allow to retrieve the currency used by default for a given country