Skip to content

kwestground/FixerSharp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FixerSharp

C# library to assist with currency conversion and exchange rates. Leverages the Fixer.io API.

FixerSharp Nuget

Installation

Can be installed as a NuGet package. In the package manager console, enter the following:

Install-Package FixerSharp

Usage

Perform a one-off conversion between two currencies:

using FixerSharp;

...

double oneHundredUsdInGbp = Fixer.Convert(Symbols.USD, Symbols.GBP, 100);
double oneThousandEurInUsd = Fixer.Convert("EUR", "USD", 1000);

If you wish to perform additional conversions, the current exchange rate can be saved and used to convert:

using FixerSharp;

...

ExchangeRate rateUsdGbp = Fixer.Rate(Symbols.USD, Symbols.GBP);

double oneHundredUsdInGbp = rateUsdGbp.Convert(100);
double oneThousandUsdInGbp = rateUsdGbp.Convert(1000);
double tenThousandUsdInGbp = rateUsdGbp.Convert(10000);

This method is recommended if you have more than one conversion to perform, as data is only retrieved from Fixer.io once.

Acknowledgements

This makes use of the fixer-io project to provide up-to-date exchange rates.

About

Currency conversion using the fixer.io API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%