thelia/currency-converter 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

thelia/currency-converter

Composer 安装命令:

composer require thelia/currency-converter

包简介

php 5.4 currency tools

README 文档

README

Currency Converter is a Library which helps you to convert a number from a currency to an another one. The converter uses provider for converting the number. Each provider embed the logic for converting this number.

Build Status License Scrutinizer Code Quality

Installation

Currency Converter is still in development and doesn't have stable version for now.

Install Currency Converter through Composer

Create a composer.json file in your project with this content :

{
    "require": {
        "thelia/currency-converter": "~1.0"
    } 

}

Usage

First, instantiate a Provider of your choice

$provider = new \Thelia\CurrencyConverter\Provider\ECBProvider();

Then inject it in the CurrencyConverter

$currencyConverty = new \Thelia\CurrencyConverter\CurrencyConverter($provider);

Your CurrencyConverter is now ready to be used. This library works with ISO Code 4217 currency.

Example :

$baseValue = new \Thelia\Math\Number('1');

$convertedValue = $currencyConverter
    ->from('EUR')
    ->to('USD')
    ->convert($baseValue);
    
echo $baseValue->getNumber(); //1.24

Providers

A provider implements a simple interface and contains all the logic for converting a Number from a Currency to an other one. Most of time a provider will use a webservice for getting the exchange rate between two currencies.

List of available providers :

Provider Description
European Central Bank All currencies quoted against the euro (base currency)
My Currency Almost all currencies.

统计信息

  • 总下载量: 100.03k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10
  • 点击次数: 4
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2014-11-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固