Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/php-decimal/extension
Correctly-rounded, arbitrary precision decimal floating-point arithmetic in PHP
https://github.com/php-decimal/extension
arbitrary-precision decimal php
Last synced: 13 days ago
JSON representation
Correctly-rounded, arbitrary precision decimal floating-point arithmetic in PHP
- Host: GitHub
- URL: https://github.com/php-decimal/extension
- Owner: php-decimal
- License: mit
- Created: 2018-10-13T15:46:50.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-05T06:31:46.000Z (11 months ago)
- Last Synced: 2024-12-02T02:05:07.873Z (25 days ago)
- Topics: arbitrary-precision, decimal, php
- Language: PHP
- Homepage: https://php-decimal.github.io/
- Size: 357 KB
- Stars: 339
- Watchers: 16
- Forks: 19
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-php-extensions - php-decimal - 提供对 decimal 的支持。官方提供纯 php 版 (数据转换)
- favorite-link - PHP 7 中的正确舍入,任意精度的十进制浮点运算。
README
# PHP Decimal Extension
[![PECL](https://img.shields.io/static/v1?message=1.4.0&label=PECL&color=blue&style=flat&logo=php)](https://pecl.php.net/package/decimal/1.3.1)
[![Build Status](https://travis-ci.org/php-decimal/ext-decimal.svg?branch=1.3)](https://travis-ci.org/php-decimal/ext-decimal)[![PECL](https://img.shields.io/static/v1?message=2.0.0-alpha&label=PECL&color=blue&style=flat&logo=php)](https://pecl.php.net/package/decimal/2.0.0)
[![Build Status](https://travis-ci.org/php-decimal/ext-decimal.svg?branch=2.0&style=flat)](https://travis-ci.org/php-decimal/ext-decimal)
[![Build status](https://ci.appveyor.com/api/projects/status/lg5nw5tqgpmv1c33?svg=true)](https://ci.appveyor.com/project/rtheunissen/php-decimal)Correctly-rounded, arbitrary-precision decimal arithmetic for PHP
## Documentation
See [php-decimal.github.io](https://php-decimal.github.io)
## Requirements
- PHP >= 7.2
- [libmpdec >= 2.4](http://www.bytereef.org/mpdecimal/download.html)## Install
```
pecl install decimal
```**Alpha**:
```
pecl install decimal-alpha
```Windows users can find *.dll* files under [releases](https://github.com/php-decimal/ext-decimal/releases).
## Enable
You can do this temporarily using `php -dextension=decimal.so` or by adding `extension=decimal.so` to your INI. If you manage PHP with [phpbrew](https://github.com/phpbrew/phpbrew), you can use `phpbrew ext enable decimal`.
## Tests
```
php run-tests.php -P -q
```