PHPackages                             pavlepredic/currency-converter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. pavlepredic/currency-converter

ActiveLibrary

pavlepredic/currency-converter
==============================

Tools for performing currency conversion

0.0.0(10y ago)176GPL-3.0+PHPPHP &gt;=5.5

Since Oct 13Pushed 10y agoCompare

[ Source](https://github.com/pavlepredic/currency-converter)[ Packagist](https://packagist.org/packages/pavlepredic/currency-converter)[ RSS](/packages/pavlepredic-currency-converter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

Currency converter
==================

[](#currency-converter)

Tools for performing currency conversion. This library might be used with Symfony2 framework, but this is not a requirement. You can use the basic exchange rate conversion utility with vanilla PHP. In order to use the storage layer, you will need Doctrine. This library is a work in progress.

Installing
==========

[](#installing)

```
composer require pavlepredic/currency-converter

```

Basic usage example
===================

[](#basic-usage-example)

```
use PavlePredic\CurrencyConverter\Service\CurrencyConverter;

$converter = new CurrencyConverter();
$converted = $converter->convert(100, 'USD', 'EUR');

```

Storing exchange rates to DB using Doctrine
===========================================

[](#storing-exchange-rates-to-db-using-doctrine)

- Create an ORM Entity that implements PavlePredic\\CurrencyConverter\\Entity\\ExchangeRateInterface
- Implement PavlePredic\\CurrencyConverter\\Repository\\ExchangeRateRepositoryInterface. The repository might look something like this:

```
