PHPackages                             coolert/number\_in\_chinese - 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. coolert/number\_in\_chinese

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

coolert/number\_in\_chinese
===========================

Convert numbers to Chinese characters

1.0.0(3y ago)09MITPHP

Since Jul 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/coolert/number_in_chinese)[ Packagist](https://packagist.org/packages/coolert/number_in_chinese)[ RSS](/packages/coolert-number-in-chinese/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

 number\_in\_chinese
=====================

[](#-number_in_chinese-)

将数字转换为中文汉字的简单php组件。支持整数与浮点数，简繁体输出，目前不支持负数。

[![Tests](https://github.com/coolert/number_in_chinese/actions/workflows/tests.yml/badge.svg)](https://github.com/coolert/number_in_chinese/actions/workflows/tests.yml)[![StyleCI build status](https://camo.githubusercontent.com/0722d7d6e980449dc528518bf0bae6a2d24e2becabd469393353d6824d23bd76/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3531373838373331332f736869656c64)](https://camo.githubusercontent.com/0722d7d6e980449dc528518bf0bae6a2d24e2becabd469393353d6824d23bd76/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3531373838373331332f736869656c64)[![Code Coverage](https://camo.githubusercontent.com/6f5c196c3198c9c3f8bae426f088ab116db1ca234d8d5486c302851630acbdc7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636f6f6c6572742f6e756d6265725f696e5f6368696e6573652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/coolert/number_in_chinese/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/72025623609319ba3d1b1ad53d38252adf6a6722969e52a6f9fc50a73ad4830d/68747470733a2f2f706f7365722e707567782e6f72672f636f6f6c6572742f6e756d6265725f696e5f6368696e6573652f762f737461626c652e737667)](https://packagist.org/packages/coolert/number_in_chinese)[![Latest Unstable Version](https://camo.githubusercontent.com/2b5149a361faa0a5d656531ce6596130167a67c6bd5e5b0431601c7e46631beb/68747470733a2f2f706f7365722e707567782e6f72672f636f6f6c6572742f6e756d6265725f696e5f6368696e6573652f762f756e737461626c652e737667)](https://packagist.org/packages/coolert/number_in_chinese)[![License](https://camo.githubusercontent.com/a96cc0ab7e689e54cfb6afcc563ca23b1cd86e41629bdd084b58655ded65ed2c/68747470733a2f2f706f7365722e707567782e6f72672f636f6f6c6572742f6e756d6265725f696e5f6368696e6573652f6c6963656e7365)](https://packagist.org/packages/coolert/number_in_chinese)

环境需求
----

[](#环境需求)

- PHP &gt;= 7.3

安装
--

[](#安装)

```
$ composer require coolert/number_in_chinese -vvv
```

使用
--

[](#使用)

```
use Coolert\NumberInChinese\Convert;
$convert = new Convert();
echo $response;
```

数字转换成中文
-------

[](#数字转换成中文)

```
$response = $convert->convertNumbers('1234567890');
```

示例：

```
一亿二千三百四十五万七千八百九十
```

参数说明
----

[](#参数说明)

```
string convertNumbers(string $number, int $dic = 1, int $unit_dic = 1)
```

- $number - 需要转换的数字
- $dic - 转换成的数字位类型：1：小写，数字'0'用'零’表示 2：小写，数字'0'用'〇‘表示 3：大写('壹','贰','叁'...)
- $unit\_dic - 转换后的单位类型：1：简体中文 2：繁体中文

在Laravel中使用
-----------

[](#在laravel中使用)

你可以有两种方式获取`Coolert\NumberInChinese\Convert`实例:

### 方法参数注入

[](#方法参数注入)

```
public function index(Convert $convert)
{
    $response = $convert->convertNumbers('123457890');
}
```

### 服务名访问

[](#服务名访问)

```
public fuction index()
{
    $response = app('convert')->convertNumbers('123457890');
}
```

License
-------

[](#license)

MIT

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% 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

Every ~43 days

Total

2

Last Release

1394d ago

Major Versions

0.0.1 → 1.0.02022-09-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/961377f76c2a68fcf7b3e389d6e1c6fa7306c95e0ea5ac695443aad5ddbba5f9?d=identicon)[coolert](/maintainers/coolert)

---

Top Contributors

[![coolert](https://avatars.githubusercontent.com/u/18160314?v=4)](https://github.com/coolert "coolert (18 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/coolert-number-in-chinese/health.svg)

```
[![Health](https://phpackages.com/badges/coolert-number-in-chinese/health.svg)](https://phpackages.com/packages/coolert-number-in-chinese)
```

###  Alternatives

[php-mqtt/laravel-client

A wrapper for the php-mqtt/client library for Laravel.

227593.3k3](/packages/php-mqtt-laravel-client)[mvo/contao-group-widget

Adds a new group widget that allows repeating a set of DCA fields.

26139.9k41](/packages/mvo-contao-group-widget)

PHPackages © 2026

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