This is an unofficial library for obtaining currency rates from Central Bank of Azerbaijan.
For Maven declare a dependency in the section of your POM file. Dependency declaration in pom.xml
<dependency>
<groupId>info.md7</groupId>
<artifactId>cbar-currency</artifactId>
<version>1.2</version>
</dependency>
compile 'info.md7:cbar-currency:1.2'
- Currency Conversion
- From AZN
- To AZN
- Getting actual currency rates from CBAR
- Actual currency rate for specified currency
- Actual currency rates for all currencies
- Currency rate for specified date
- Currency rates for specified dates
- Add this library into dependencies
- Use static methods from CurrencyConverter to currency conversion functionality
- Use static methods from CurrencyRate to getting currency rates functionality
import info.md7.cbar_currency.model.CurrencyCode;
import info.md7.cbar_currency.util.CurrencyRate;
import java.time.LocalDate;
public class Main {
public static void main(String ... args) {
CurrencyConverter.convertFromAzn(BigDecimal.valueOf(100), CurrencyCode.BYN);
CurrencyConverter.convertToAzn(BigDecimal.valueOf(100), CurrencyCode.BYN);
CurrencyRate.getActualCurrencyRates();
CurrencyRate.getActualCurrencyRate(CurrencyCode.BYN);
CurrencyRate.getCurrencyRateForDate(CurrencyCode.BYN, LocalDate.of(2020, 11, 5));
CurrencyRate.getCurrencyRatesForDate(LocalDate.of(2020, 11, 5));
}
}