承接 putheakhem/khmer-number-to-text 相关项目开发

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

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

putheakhem/khmer-number-to-text

最新稳定版本:v1.0.1

Composer 安装命令:

composer require putheakhem/khmer-number-to-text

包简介

Convert Khmer numbers to Khmer text representation

README 文档

README

Latest Stable Version Total Downloads License

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 • កម្ពុជា

🕊️ 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

composer require putheakhem/khmer-number-to-text

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

🚀 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

Basic Example

use Putheakhem\KhmerNumberToText\Facades\KhmerNumber;

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

Helper

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

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

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

📚 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

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

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

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

📄 License

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

Built with ❤️ by Puthea khem

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固