定制 davidvandertuijn/number_format_precision 二次开发

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

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

davidvandertuijn/number_format_precision

最新稳定版本:1.0

Composer 安装命令:

composer require davidvandertuijn/number_format_precision

包简介

Number Format Precision

README 文档

README

Total Downloads Latest Stable Version License

Number Format Precision

The “Number Format Precision” tool is designed to provide precise control over the formatting of numerical values in PHP, specifically addressing the need for truncating decimals without rounding. This functionality is particularly useful for developers who require exact numerical representation in financial applications, scientific calculations, or any scenario where rounding could lead to inaccuracies.

PHP built-in function number_format rounds by default, this library truncates decimals without rounding.

"Buy Me A Coffee"

Install

composer require davidvandertuijn/number_format_precision

Usage

Using PHP built-in function number_format:

number_format(1234.5678, 2, '.', ''); // 1234.57

Using number_format_precision:

number_format_precision(1234.5678, 2, "int")); // 1234.56
number_format_precision(1234.5678, 2, "string")); // "1234.56"

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固