HawkN.Iso.Countries.Currencies 8.0.2

dotnet add package HawkN.Iso.Countries.Currencies --version 8.0.2
                    
NuGet\Install-Package HawkN.Iso.Countries.Currencies -Version 8.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HawkN.Iso.Countries.Currencies" Version="8.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HawkN.Iso.Countries.Currencies" Version="8.0.2" />
                    
Directory.Packages.props
<PackageReference Include="HawkN.Iso.Countries.Currencies" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HawkN.Iso.Countries.Currencies --version 8.0.2
                    
#r "nuget: HawkN.Iso.Countries.Currencies, 8.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HawkN.Iso.Countries.Currencies@8.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HawkN.Iso.Countries.Currencies&version=8.0.2
                    
Install as a Cake Addin
#tool nuget:?package=HawkN.Iso.Countries.Currencies&version=8.0.2
                    
Install as a Cake Tool

HawkN.Iso.Countries.Currencies

HawkN.Iso.Countries.Currencies provides ISO-based mapping of primary and secondary currencies for countries. It allows you to quickly retrieve the main currency, secondary currencies, all currencies, or check if a currency is used by a specific country.

Features

  • Primary and Secondary Currencies – Get the main currency or all secondary currencies of a country.
  • Fast Lookups – O(1) lookups using pre-indexed dictionaries and HashSet for secondary currencies.
  • Currency Validation – Check if a country uses a given currency.
  • Seamless Integration – Built to work with HawkN.Iso.Countries types (CountryCode.TwoLetterCode).
  • Lightweight & Dependency-Free – Compatible with .NET 8 and above.

Getting Started

Install via NuGet

dotnet add package HawkN.Iso.Countries.Currencies
References

Required Namespaces

using HawkN.Iso.Currencies;
using HawkN.Iso.Countries;
using HawkN.Iso.Countries.Abstractions;
using HawkN.Iso.Countries.Extensions;
using HawkN.Iso.Currencies.Extensions;
using HawkN.Iso.Countries.Currencies.Extensions;

Usage Example

Get Main Currency
var mainCurrency = CountryCode.TwoLetterCode.US.GetPrimaryCurrency();
Console.WriteLine($"Primary currency of US: {mainCurrency}"); // USD
Get Secondary Currencies
var secondaryCurrencies = CountryCode.TwoLetterCode.BO.GetSecondaryCurrencies();
Console.WriteLine($"Secondary currencies of BO: {string.Join(", ", secondaryCurrencies)}"); // BOV

Get all Currencies for specific country

var allCurrencies = CountryCode.TwoLetterCode.BO.GetAllCurrencies();
Console.WriteLine($"All currencies of BO: {string.Join(", ", allCurrencies)}"); // BOB, BOV
Validation

Check if Currency is Used by Country

bool isUsed = CountryCode.TwoLetterCode.BO.IsCurrencyUsedByCountry(CurrencyCode.BOB); // True
bool isUsdUsed = CountryCode.TwoLetterCode.BO.IsCurrencyUsedByCountry(CurrencyCode.USD); // False

License

Code

This project’s source code is licensed under the MIT License.

Data

This project uses data derived from the following sources:

The above data licenses are permissive and compatible with MIT-licensed code
when used for reference and code generation.

See DATA-LICENSE for details.


References

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.2 156 1/16/2026
8.0.1 141 1/10/2026

- Added support for .NET 8.0
           - Initial release with Country - Currency mapping.
           - Lightweight & dependency-free