microsoft / referencesource

Source from the Microsoft .NET Reference Source that represent a subset of the .NET Framework
https://referencesource.microsoft.com/
MIT License
3.17k stars 1.27k forks source link

Get RegionInfo based on ISO codes and from ISO Codes #114

Closed Ellerbach closed 1 year ago

Ellerbach commented 5 years ago

So far, it's only possible to get a RegionInfo from its name. Would be great to get the RegionInfo from the ISO Codes. Something like:

List<RegionInfo> regions = RegionInfo.FromISOCurrencySymbol("EUR");

What is missing as well is to get the ISO country number (ISO 3166-1) and the ISO currency number (ISO 4217). So properties like ISOCountryCodeNumber as well as ISOCurrencyCodeNumber and same as for the previous point, have a way to get all the RegionInfo based on those codes:

RegionInfo france = RegionInfo.FromISOCountryCodeNumber(250);
List<RegionInfo> allEuroCountries = RegionInfo.FromISOCurrencyCodeNumber(978);

ISO Country Number: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes ISO currency number: https://en.wikipedia.org/wiki/ISO_4217

terrajobst commented 1 year ago

This repository does not accept feature requests or bug reports. To submit those, you need to go elsewhere: