eugabrielsilva/currency
最新稳定版本:v1.0.0
Composer 安装命令:
composer require eugabrielsilva/currency
包简介
PHP currency manipulation class.
README 文档
README
This package is a translation of currency.js for PHP. It was built to work around floating point issues when working with currency values.
Currency works with values as integers behind the scenes, resolving some of the most basic precision problems.
Installation
composer require eugabrielsilva/currency
Usage
With real numbers:
$result = currency(3.2)->multiply(0.5)->add(1)->value;
With currency instances:
$value1 = currency(3.2); $value2 = currency(0.5); $value3 = currency(1); $result = $value1->multiply($value2)->add($value3)->value;
Formatting:
$value = currency(3.2)->multiply(0.5)->add(1); echo $value->format();
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-03