PHPackages                             konthaina/khmer-format - 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. konthaina/khmer-format

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

konthaina/khmer-format
======================

Khmer formatting utilities for time and money (digits or Khmer words).

v0.3.2(3mo ago)02MITPHPPHP &gt;=8.0CI passing

Since Feb 16Pushed 3mo agoCompare

[ Source](https://github.com/Konthaina/khmer-format-php)[ Packagist](https://packagist.org/packages/konthaina/khmer-format)[ RSS](/packages/konthaina-khmer-format/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (1)Versions (7)Used By (0)

khmer-format (PHP)
==================

[](#khmer-format-php)

Khmer formatting utilities for time and money.

Install
-------

[](#install)

```
composer require konthaina/khmer-format
```

Time Formatter
--------------

[](#time-formatter)

```
require_once __DIR__ . '/vendor/autoload.php';

use KhmerFormat\KhmerTimeFormatter;

echo KhmerTimeFormatter::format("1:22 PM", "digits"); // ម៉ោង១ និង ២២ នាទី រសៀល
echo KhmerTimeFormatter::format("13:22", "words");    // ម៉ោងមួយ និង ម្ភៃពីរ នាទី រសៀល
echo KhmerTimeFormatter::formatNow("digits");
echo KhmerTimeFormatter::formatNow("words", "Asia/Phnom_Penh");
```

Features:

- Accepts 12-hour (`1:22 PM`) and 24-hour (`13:22`) input.
- Outputs Khmer time in digits or Khmer words.
- Includes `formatNow()` for real current time.
- Supports timezone input (for example `Asia/Phnom_Penh`).

Money Formatter
---------------

[](#money-formatter)

```
use KhmerFormat\KhmerMoneyFormatter;

echo KhmerMoneyFormatter::formatKHR(15000);              // ១៥,០០០ ៛
echo KhmerMoneyFormatter::formatUSD(15000);              // $15,000.00
echo KhmerMoneyFormatter::toKhmerWordsKHR(15000);        // មួយម៉ឺនប្រាំពាន់ រៀល
echo KhmerMoneyFormatter::toKhmerWordsUSD(15000);        // មួយម៉ឺនប្រាំពាន់ ដុល្លារ
echo KhmerMoneyFormatter::format('KHR', 15000, false);   // 15,000 ៛
echo KhmerMoneyFormatter::format('USD', 15000);          // $15,000.00
```

Features:

- KHR formatting with no decimals.
- USD formatting with 2 decimals.
- Khmer word output for KHR and USD.
- Proper currency symbols (`៛`, `$`).

Test
----

[](#test)

```
composer install
composer test
```

Release
-------

[](#release)

```
git tag v0.3.2
git push --tags
```

Then update the package on Packagist (or use webhook auto-update).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance82

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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

6

Last Release

92d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/143169514?v=4)[Kon Thaina](/maintainers/Konthaina)[@Konthaina](https://github.com/Konthaina)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/konthaina-khmer-format/health.svg)

```
[![Health](https://phpackages.com/badges/konthaina-khmer-format/health.svg)](https://phpackages.com/packages/konthaina-khmer-format)
```

PHPackages © 2026

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