Skip to content

mkueh/CurrencyConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9a43137 · Jun 12, 2021

History

22 Commits
May 31, 2021
May 8, 2021
May 8, 2021
May 8, 2021
Jun 12, 2021

Repository files navigation

CurrencyConverter

My small currencyconvert in Rust, that only support European Central Bank exchange rates. This is my first project in Rust :)

Example

    let mut Exchanger = Currency_Exchange::Exchange::new();
    let date = NaiveDate::from_ymd(2020, 1, 15);
    Exchanger.init();
    let rate = Exchanger.get_ExchangeRate(Currency_Exchange::Currency_CODE::USD,Currency_Exchange::Currency_CODE::EUR, date).unwrap();
    assert_approx_eq!(rate, 1.1142, 0.00001);

Exchange::new() automatically loads the current exchange rates from the ECB during initialization (https://sdw-wsrest.ecb.europa.eu/service/data/EXR/)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages