EasyExchangeRate 0.5.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package EasyExchangeRate --version 0.5.1
NuGet\Install-Package EasyExchangeRate -Version 0.5.1
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="EasyExchangeRate" Version="0.5.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasyExchangeRate --version 0.5.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EasyExchangeRate, 0.5.1"
#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.
// Install EasyExchangeRate as a Cake Addin #addin nuget:?package=EasyExchangeRate&version=0.5.1 // Install EasyExchangeRate as a Cake Tool #tool nuget:?package=EasyExchangeRate&version=0.5.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EasyExchangeRate
Some central bank exchange rates
<details> <summary>Todo</summary>
- Add more country
- JSON serialize
- Nuget package
- Web deploy(open api)
- Add number to word localizations
- Turkish
- English
- Affrikan
- Arabic
- Armenian
- Azerbaijani
- Bangla
- Bulgarian
- Chinese
- Croatian
- Czech
- Farsi
- Finnish
- French
- German
- Greek
- Indian
- Italian
- Japanese
- Korean
- Latvian
- Polish
- Romanian
- Russian
- Spanish
- Tamil
- Thai
- Ukrainian
- Uzbek
- Vietnamase
</details>
Adapter List
- TurkeyAdapter
- EuropeAdapter
- DenmarkAdapter
- IsraelAdapter
- RussiaAdapter
- AustraliaAdapter
- PolandAdapter
- CanadaAdapter
Usage
*Get Currencies
ExchangeRate.EuropeAdapter.Currencies.ForEach(currency =>
{
Console.WriteLine(currency.ToString());
});
Output
US Dollar
Japanese Yen
Bulgarian lev
Czech koruna
Danish krone
British Pound
Hungarian Forint
Polish Zloty
Romanian Leu
Swedish Krona
Swiss franc
Icelandic Króna
Norwegian Krone
Croatian Kuna
Turkish Lira
Australian dollar
Brazilian real
Canadian dollar
Renminbi
Hong Kong Dollar
Indonesian Rupiah
Israeli New Shekel
Indian Rupee
South Korean Won
Mexican Peso
Malaysian Ringgit
New Zealand Dollar
Philippine Piso
Singapore Dollar
Thai Baht
CFP franc
*Get Rate
var rate = ExchangeRate.TurkeyAdapter.GetRate(CurrencyCodes.EUR);
Console.WriteLine($"1 {rate.TargetCurrency.Name} = {rate.Money.Amount} {rate.Money.Currency.IsoCode}" );
Output
Base Currency : Turkish Lira
Rate : 1 Euro = 18,0545 TRY
*Get Rates
ExchangeRate.TurkeyAdapter.GetRates().ForEach(rate =>
{
Console.WriteLine($"1 {rate.TargetCurrency.Name} = { rate.Money.Amount} {rate.Money.Currency.IsoCode}");
});
Output
Base Currency : Turkish Lira
Rates :
1 US Dollar = 18,2050 TRY
1 Australian dollar = 12,3295 TRY
1 Danish krone = 2,4240 TRY
1 Euro = 18,0545 TRY
1 British Pound = 20,8916 TRY
1 Swiss franc = 18,4913 TRY
1 Swedish Krona = 1,6740 TRY
1 Canadian dollar = 13,8206 TRY
1 Kuwaiti Dinar = 58,6698 TRY
1 Norwegian Krone = 1,8133 TRY
1 Saudi Riyal = 4,8436 TRY
1 Japanese Yen = 12,9276 TRY
1 Bulgarian lev = 9,2100 TRY
1 Romanian Leu = 3,7237 TRY
1 Russian Ruble = 0,29787 TRY
1 Iranian Rial = 0,04310 TRY
1 Renminbi = 2,6103 TRY
1 Pakistani Rupee = 0,08247 TRY
1 Qatari Rial = 4,9327 TRY
1 South Korean Won = 0,01320 TRY
1 Azerbaijani manat = 10,6551 TRY
1 United Arab Emirates dirham = 4,9286 TRY
1 Special Drawing Rights = 23,6160 TRY
*Convert
var convert = ExchangeRate.TurkeyAdapter.HowMuch<EurCurrency, UsdCurrency>(1);
Console.WriteLine($"1 {convert.TargetCurrency.ToString()} = {Math.Round(convert.Money.Amount, 4)}{convert.Money.Currency.Symbol} ");
Output
1 Euro = 0,9917$
*Operators
var rateUsd = ExchangeRate.EuropeAdapter.GetRate(CurrencyCodes.USD);
Console.WriteLine($"1 {rateUsd.Money.Currency.Name } = {rateUsd.Money.Amount} {rateUsd.TargetCurrency.Name}");
Console.WriteLine($"Plus +3 = " + (rateUsd + 3));
Console.WriteLine($"Minus -1.5 = " + (rateUsd - 1.3M));
Console.WriteLine($"Divide 2 = " + (rateUsd / 2));
Console.WriteLine($"Multiply 5 = " + (rateUsd * 5));
Output
1 Euro = 0,9920 US Dollar
Plus +3 = 3,9920 USD
Minus -1.5 = -0,3080 USD
Divide 2 = 0,4960 USD
Multiply 5 = 4,9600 USD
*Sum Two Rate
...
*Rate To Word / Number To Word
Code :
ExchangeRate.TurkeyAdapter.GetRate(CurrencyCodes.EUR).Do(rate =>
{
Console.WriteLine(EnglishNumberToWordsConverter.New().ToWord(rate));
});
Output :
Eighteen Turkish Lira One Thousand Nine Hundred Fifty Four kuruş
Code :
Console.WriteLine(EnglishNumberToWordsConverter.New().Convert(1000100));
Console.WriteLine(TurkishNumberToWordConverter.New().Convert(1000100));
Output :
One Million One Hundred
Bir Milyon Yüz
*Word To Number
Code :
Console.WriteLine(EnglishNumberToWordsConverter.New().Convert("One Billion Two Hundred Thirty Four Million Five Hundred Sixty Seven Thousand Eight Hundred Ninety Two"));
Console.WriteLine(TurkishNumberToWordConverter.New().Convert("Bir Milyar İki Yüz Otuz Dört Milyon Beş Yüz Altmış Yedi Bin Sekiz Yüz Doksan İki"));
Output :
1234567892
1234567892
*Humanizer
Code
Rate rate = ExchangeRate.TurkeyAdapterHumanizer.EUR.DövizKuru;
Console.WriteLine($"1 {rate.TargetCurrency.Name} = {rate.Money.Amount} {rate.Money.Currency.IsoCode}" );
Output
1 Euro = 18,5130 TRY
Code
List<Rate> rates = ExchangeRate.TurkeyAdapterHumanizer.EUR.USD.DövizKuru;
rates.ForEach(rate => Console.WriteLine($"1 {rate.TargetCurrency.Name} = {rate.Money.Amount} {rate.Money.Currency.IsoCode}"));
Output
1 US Dollar = 18,2205 TRY
1 Euro = 18,5130 TRY
Code
List<Rate> convert = ExchangeRate.TurkeyAdapterHumanizer.USD.EUR.GBP.Çevir;
convert.ForEach(rate => Console.WriteLine($"1 {rate.TargetCurrency.Name} = {rate.Money.Amount} {rate.Money.Currency.IsoCode}"));
Output
1 US Dollar = 0,9842 EUR
1 US Dollar = 0,8546 GBP
*JSON
Console.WriteLine($"Base Currency : {ExchangeRate.TurkeyAdapter.BaseCurrency.Name}");
ExchangeRate.TurkeyAdapter.GetRate(CurrencyCodes.USD).Do(rate =>
{
Console.WriteLine($"Rate : {EnglishNumberToWordsConverter.New().ToWord(rate)}");
Console.WriteLine(rate.ToJson());
});
Output
Base Currency : Turkish Lira
Rate word : Eighteen Turkish Lira Five Thousand Five Hundred Fifty kuruş
{
"TargetCurrency": {
"Symbol": "$",
"IsoCode": 840,
"NumericCode": "840",
"Name": "US Dollar",
"SubUnit": "Cent"
},
"Money": {
"Amount": 18.5550,
"Currency": {
"Symbol": "₺",
"IsoCode": 949,
"NumericCode": "949",
"Name": "Turkish Lira",
"SubUnit": "kuruş"
}
}
}
free icon : https://www.iconfinder.com/icons/8725865/exchange_icon
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net5.0
- Newtonsoft.Json (>= 13.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.