PHPackages                             putheakhem/khmer-number-to-text - 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. putheakhem/khmer-number-to-text

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

putheakhem/khmer-number-to-text
===============================

Convert Khmer numbers to Khmer text representation

v1.0.1(1y ago)1651MITPHPPHP ^8.2

Since May 19Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/putheakhem/khmer-number-to-text)[ Packagist](https://packagist.org/packages/putheakhem/khmer-number-to-text)[ RSS](/packages/putheakhem-khmer-number-to-text/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (3)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/831d7bec88b1fd8c54aac2234b539a85f3dfd81ba6799040b06871c828e67201/68747470733a2f2f706f7365722e707567782e6f72672f7075746865616b68656d2f6b686d65722d6e756d6265722d746f2d746578742f762f737461626c65)](https://packagist.org/packages/putheakhem/khmer-number-to-text)[![Total Downloads](https://camo.githubusercontent.com/c9169052e8c10ba09e9a99742bcb3f38291a0970d3d39c13a5e359f2816b8dcb/68747470733a2f2f706f7365722e707567782e6f72672f7075746865616b68656d2f6b686d65722d6e756d6265722d746f2d746578742f646f776e6c6f616473)](https://packagist.org/packages/putheakhem/khmer-number-to-text)[![License](https://camo.githubusercontent.com/37bd9d2d56ee90450b85c88b9020e86493d650e4ca06cdc5baf1e1e898676faf/68747470733a2f2f706f7365722e707567782e6f72672f7075746865616b68656d2f6b686d65722d6e756d6265722d746f2d746578742f6c6963656e7365)](https://packagist.org/packages/putheakhem/khmer-number-to-text)

Khmer Number To Text
====================

[](#khmer-number-to-text)

Convert Arabic or Khmer digit numbers into **Khmer written text format** (spoken form), suitable for invoices, financial documents, education, and legal reporting in the Khmer language.

---

🇰🇭 Stand with Cambodia • កម្ពុជា
--------------------------------

[](#-stand-with-cambodia--កម្ពុជា)

### 🕊️ Cambodia Needs Peace 🕊️

[](#️-cambodia-needs-peace-️)

With heavy hearts, we stand with our brave soldiers defending Cambodia’s land and dignity.
We seek no conflict—only peace, justice, and respect for our sovereignty.

**🙏 កម្ពុជាត្រូវការសន្តិភាព • Together to protect Cambodia’s sovereignty.**

---

📦 Installation
--------------

[](#-installation)

```
composer require putheakhem/khmer-number-to-text
```

> For local development, use a path-based repository in your Laravel project.

---

🚀 Features
----------

[](#-features)

- ✅ Supports both Arabic (`1234`) and Khmer (`១២៣៤`) digit inputs
- ✅ Outputs proper Khmer number words (e.g., `1234 → មួយពាន់ពីររយសាមសិបប្រាំបួន`)
- ✅ Proper handling of:

    - Single digits (`6 → ប្រាំមួយ`)
    - Tens (`40 → សែសិប`)
    - Hundreds, Thousands, Millions (`1234567 → មួយលានពីររយសាមសិបប្រាំបួន`)
- ✅ Laravel Facade support: `KhmerNumber::toText(1234)`

---

🔧 Usage
-------

[](#-usage)

### Basic Example

[](#basic-example)

```
use Putheakhem\KhmerNumberToText\Facades\KhmerNumber;

echo KhmerNumber::toText(1234);    // មួយពាន់ពីររយសាមសិបប្រាំបួន
echo KhmerNumber::toText('៦៧៨៩');  // ប្រាំមួយពាន់ប្រាំពីររយប៉ែតសិបប្រាំបួន...
```

### Helper

[](#helper)

If you prefer, you can use the global helper function:

```
echo khmer_number_to_text(2025); // ពីរពាន់ម្ភៃប្រាំ

echo khmer_number_to_text('១២៣៤'); // មួយពាន់ពីររយសាមសិបប្រាំបួន
```

📚 Internals
-----------

[](#-internals)

This package relies on:

- `KhmerNumberConstants` — a centralized definition of:

    - Khmer digit word mappings
    - Tens word patterns (e.g., `60 → ហុកសិប`)
    - Large unit labels (`លាន`, `ពាន់`, `រយ`)
- Recursive `convertNumber()` logic to handle number decomposition
- Laravel Facade binding via `KhmerNumber`

---

🛠️ Contributing
---------------

[](#️-contributing)

Contributions are welcome! Please follow these steps:

1. Fork the repository
2. Create a new branch (`git checkout -b feature/YourFeature`)
3. Make your changes
4. Commit your changes (`git commit -m 'Add some feature'`)
5. Push to the branch (`git push origin feature/YourFeature`)
6. Create a new Pull Request
7. Ensure your code adheres to the coding standards and passes all tests

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability within this package, please send an e-mail to puthea.khem at gmail.com. All security vulnerabilities will be promptly addressed.

Support Me
----------

[](#support-me)

If you find this package useful, consider supporting my work:

- [Buy me a coffee](https://www.buymeacoffee.com/iamputhea)

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

Built with ❤️ by [Puthea khem](mailto:puthea.khem@gmail.com)

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance61

Regular maintenance activity

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Every ~0 days

Total

2

Last Release

410d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/764935335a012f6477a36e9bf81144d2c887becfbd0dea300426a27f7677ab93?d=identicon)[putheakhem](/maintainers/putheakhem)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/putheakhem-khmer-number-to-text/health.svg)

```
[![Health](https://phpackages.com/badges/putheakhem-khmer-number-to-text/health.svg)](https://phpackages.com/packages/putheakhem-khmer-number-to-text)
```

###  Alternatives

[milo/hydrator

Hydrates object from array, exports object to array

2572.2k](/packages/milo-hydrator)[xmeltrut/word-search

Word search generator.

107.0k](/packages/xmeltrut-word-search)

PHPackages © 2026

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