承接 indibeast/currency-formatter 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

indibeast/currency-formatter

最新稳定版本:v1.0

Composer 安装命令:

composer require indibeast/currency-formatter

包简介

Currency Formatter

README 文档

README

Build Status Coverage Status Code Climate Total Downloads Latest Unstable Version License

Minimum Requirements

  • PHP 5.5+

Installation

Install using composer:

composer require indibeast/currency-formatter

Example

 $price = new Currency\Price(3000,'LKR');
 $price->pretty();// Rs 3,000.00

You can pass the options as an array to the third parameter.

 $price = new Currency\Price(3000,'LKR',['show_decimal' => false,'seperator' => ',']);
 $price->pretty();// Rs 3,000

Currency conversion

 $currency = new Price(1,'USD');
 $currency->setConverter(new OpenExchangeConverter('app_id'));// Pass true as second parameter if you are having an enterprise APP_ID.
 $currency->convert('LKR') // This will convert U.S Dollars to Sri Lankan Rupees

If you wish to implement your own currency exchange provider implement \Currency\Converter\ConverterInterface

 class FixedConverter implements ConverterInterface{

    /**
     * @return float
     */
    public function getConversionRate($code,$to)
    {
        return 1;
    }
 }

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 108
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 20
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 20
  • Watchers: 4
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-16