EuropeanCentralBank.ExchangeRates
1.0.1
See the version list below for details.
dotnet add package EuropeanCentralBank.ExchangeRates --version 1.0.1
NuGet\Install-Package EuropeanCentralBank.ExchangeRates -Version 1.0.1
<PackageReference Include="EuropeanCentralBank.ExchangeRates" Version="1.0.1" />
paket add EuropeanCentralBank.ExchangeRates --version 1.0.1
#r "nuget: EuropeanCentralBank.ExchangeRates, 1.0.1"
// Install EuropeanCentralBank.ExchangeRates as a Cake Addin #addin nuget:?package=EuropeanCentralBank.ExchangeRates&version=1.0.1 // Install EuropeanCentralBank.ExchangeRates as a Cake Tool #tool nuget:?package=EuropeanCentralBank.ExchangeRates&version=1.0.1
EuropeanCentralBank.ExchangeRates
European CentralBank ExchangeRates Api Client for C# / uses the European Central Bank's daily feed for accuracy
Port of https://github.com/facundofarias/ecb-exchange-rates
Installation
Usage
Using the libary should be straight forward
Get Currencies information (Interfaces can be mocked for testing purpose)
IExchangeRatesSource source = new ExchangeRatesSource();
var rates = await source.GetCurrenciesAsync();
Currencies conversion (always using Euro as a base) Using double rule of 3 for calculation with a non euro base conversion.
IExchangeRatesCalculator calculator = new ExchangeRatesCalculator(source); // will take any IExchangeRatesSource
double originalAmount = 40;
var amountInEuros = await calculator.Calculate(Currencies.USDollar, Currencies.Euro, originalAmount);
Console.WriteLine($"You spent {originalAmount} US and it is equals to {amountInEuros} in EU");
// from chf to dollar
originalAmount = 100;
var amountInDollars = await calculator.Calculate(Currencies.SwissFranc, Currencies.USDollar, originalAmount);
Console.WriteLine($"You spent {originalAmount} CHF and it is equals to {amountInDollars} in USD");
Here is a sample https://github.com/davidrevoledo/EuropeanCentralBank.ExchangeRates/tree/master/src/ECB.Sample
Supported Currencies
- AUD - Australian Dollar
- BGN - Bulgarian Lev
- BRL - Brazilian Real
- CAD - Canadian Dollar
- CHF - Swiss Franc
- CNY - Chinese Yuan
- CZK - Czech Koruna
- DKK - Danish Krone
- EUR - Euro
- GBP - British Pound
- HKD - Hong Kong Dollar
- HRK - Croatian Kuna
- HUF - Hungarian Forint
- IDR - Indonesian Rupiah
- ILS - Israeli New Shekel
- INR - Indian Rupee
- JPY - Japanese Yen
- KRW - South Korean Won
- LTL - Lithuanian Litas
- LVL - Latvian Lats
- MXN - Mexian Peso
- MYR - Malaysian Ringgit
- NOK - Norwegian Krone
- NZD - New Zealand Dollar
- PHP - Phillippine Peso
- PLN - Polish Zloty
- RON - Romanian New Leu
- RUB - Russian Rouble
- SEK - Swedish Krona
- SGD - Singapore Dollar
- THB - Thai Baht
- TRY - Turkish Lira
- USD - US Dollar
- ZAR - South African Rand
Disclaimer ECB Api may remove some of the supported currencies, the library is ready to don't break in that case but nothing will be retrieved for that currency, for more information please see : https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/index.en.html
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.1
- Newtonsoft.Json (>= 11.0.2)
-
.NETStandard 2.0
- Newtonsoft.Json (>= 11.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.