承接 eugabrielsilva/currency 相关项目开发

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

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

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-03