clippings / currency-convert
此包已被弃用且不再维护。未建议替代包。
Money 包的货币转换
0.1
2014-06-10 11:57 UTC
Requires
- clippings/psr-cache: ~0.1
- sebastian/money: ~1.3
This package is not auto-updated.
Last update: 2022-02-01 12:35:56 UTC
README
Money 包的货币转换
用法
将 100 英镑转换为对应的欧元金额,基于欧洲中央银行的每日汇率
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'));
您必须使用源对象初始化转换器 - 默认为 ECBSource。它还需要一个缓存池对象(基于 PSR Cache)
许可证
版权(c)2014,Clippings Ltd. 由 Ivan Kerin 开发
在 BSD-3-Clause 许可证下,请参阅 LICENSE 文件。