定制 webit/bcmath 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

webit/bcmath

最新稳定版本:2.0.2

Composer 安装命令:

composer require webit/bcmath

包简介

Object wrapper for PHP BcMath Library

README 文档

README

This library provides immutable representation of BcMath number supporting all BcMath extension operations (see http://php.net/manual/en/book.bc.php)

Installation

Composer: add the webit/bcmath into composer.json

{
    "require": {
        "php": ">=7.1.0",
        "webit/bcmath": "^2.0.0"
    }
}

Usage

    $num = new BcMathNumber('123.1233');
    $result = $num->add('13.22')->mul('3.05');
    echo $result . "\n";

Release note

This version 2.0 breaks a backward compatibility. Since now BcMathNumber:

  • is marked final
  • constants are marked private
  • works only for PHP >= 7.1

Version 1.1 breaks a backward compatibility. Since now BcMathNumber:

  • is immutable (removed setValue method)
  • has no instance property scale (removed instance methods getScale / setScale) as number itself can't have a scale

To use previous version see tag 1.0.0 https://github.com/dbojdo/bcmath/tree/1.0.0

Tests

docker-compose run --rm src composer install
docker-compose run --rm phpunit

统计信息

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

GitHub 信息

  • Stars: 17
  • Watchers: 3
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-10-17