PHPackages                             swordying/num2rmb - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. swordying/num2rmb

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

swordying/num2rmb
=================

阿拉伯数字转化为汉字大写钱数

1.0.0(2y ago)03MITPHP

Since Oct 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Swordying/num2rmb)[ Packagist](https://packagist.org/packages/swordying/num2rmb)[ RSS](/packages/swordying-num2rmb/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

阿拉伯数字转化为汉字大写钱数
==============

[](#阿拉伯数字转化为汉字大写钱数)

- 目的：防止轻易伪造纸质文档中的数字

1、整理《会计基础工作规范》关键点
-----------------

[](#1整理会计基础工作规范关键点)

1. 汉字大写金额的单位有 元、角、分 等
2. 汉字大写金额的关键字：零、壹、贰、叁、肆、伍、陆、柒、捌、玖、拾、佰、仟、万、亿等
3. 阿拉伯数字转汉字大写时，从右到左每 4 位分割一组
4. 大写金额数字到元或者角为止的，在 元 或者 角 字之后应当写 整 字，大写金额数字有分的，分字后面不写 整
5. 大写金额数字前未印有货币名称的，应当加填货币名称，即 "人民币"，货币名称与金额数字之间不得留有空白
6. 阿拉伯金额数字中间有 0 时，汉字大写金额要写 零 字
7. 阿拉伯数字金额中间连续有几个 0 时，汉字大写金额中可以只写一个 零 字

2、composer 安装
-------------

[](#2composer-安装)

- `$ composer require swordying/num2rmb`

### 代码示例

[](#代码示例)

```
// 引入类文件
require __DIR__.'/vendor/autoload.php';
## 声明配置项 默认 []
$config = [
    'start_mark' => '¥', ## 开始标志 默认：人民币
    'end_mark' => '正', ## 结束标志 默认：整
    'negative_mark' => '欠', ## 负数标志 默认：负
];
// 实例化
$numb2rmb = new \Swordying\num2rmb($config);

$number = 123456789.01;
$result = $numb2rmb -> handle($number);

echo $result; ## ¥壹亿贰仟叁佰肆拾伍万陆仟柒佰捌拾玖元零壹分
```

备注
--

[](#备注)

1. 支持负数，小数点后两位
2. 数字范围：0-100 万亿

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

938d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b489d15c5d1e3850595867542f0105337e83831420b36594469b349128ab342?d=identicon)[Swordying](/maintainers/Swordying)

---

Top Contributors

[![Swordying](https://avatars.githubusercontent.com/u/20862065?v=4)](https://github.com/Swordying "Swordying (3 commits)")

### Embed Badge

![Health badge](/badges/swordying-num2rmb/health.svg)

```
[![Health](https://phpackages.com/badges/swordying-num2rmb/health.svg)](https://phpackages.com/packages/swordying-num2rmb)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
