clippings/currency-convert

Currency Conversion for the Money package

Installs: 234

Dependents: 1

Stars: 1

Watchers: 2

Language: PHP

0.1 2014-06-10 11:57 UTC

README

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version

Currency Conversion for the Money package

Usage

Convert £100 to corresponding € amount, based on the daily rate of the European Central Bank

use CL\CurrencyConvert\Converter;
use CL\FileCache\ItemPool;
use SebastianBergmann\Money\GBP;
use SebastianBergmann\Money\Currency;

Converter::initialize(new ECBSource(new ItemPool()));

$hundred_pounds = new GBP(10000);

$converted = Converter::get()->convet($hundred_pounds, new Currency('EUR'));

You have to initialize the converter with a source object - default is ECBSource. It also requires a cache pool object (based on PSR Cache)

License

Copyright (c) 2014, Clippings Ltd. Developed by Ivan Kerin

Under BSD-3-Clause license, read LICENSE file.