clippings/currency-convert

This package is abandoned and no longer maintained. No replacement package was suggested.

Currency Conversion for the Money package

0.1 2014-06-10 11:57 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:35:56 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()->convert($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.