PHPackages                             sanmai/japanese-numerals - 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. sanmai/japanese-numerals

ActiveLibrary

sanmai/japanese-numerals
========================

Library to convert Japanese numeral to their Western variants (AKA Hindu-Arabic numerals)

v0.1.3(2y ago)214.6k—0%[1 issues](https://github.com/sanmai/JapaneseNumeral/issues)MITPHPPHP &gt;=7.4

Since Nov 30Pushed 2y ago2 watchersCompare

[ Source](https://github.com/sanmai/JapaneseNumeral)[ Packagist](https://packagist.org/packages/sanmai/japanese-numerals)[ RSS](/packages/sanmai-japanese-numerals/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

[![Build Status](https://camo.githubusercontent.com/e1d89169ebea5e9db8518372c924d0054fb693a9cf96cf14ce39869c64d7e22c/68747470733a2f2f7472617669732d63692e6f72672f73616e6d61692f4a6170616e6573654e756d6572616c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sanmai/JapaneseNumeral)[![Coverage Status](https://camo.githubusercontent.com/eb6b4e65dc8074f09ba8151cf24b7401fea2da66c44c7bb675e36542834a7fad/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f73616e6d61692f4a6170616e6573654e756d6572616c2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/sanmai/JapaneseNumeral?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/b1068ed5faded439eeeb1ccda6756776694f8cd0080147b1317d12eb97bc0ad2/68747470733a2f2f706f7365722e707567782e6f72672f73616e6d61692f6a6170616e6573652d6e756d6572616c732f76657273696f6e)](https://packagist.org/packages/sanmai/japanese-numerals)[![License](https://camo.githubusercontent.com/e0792792730d76a6e79e50a4cd40d5d3a38aab3e3996f32e53c6f6fa878ca173/68747470733a2f2f706f7365722e707567782e6f72672f73616e6d61692f6a6170616e6573652d6e756d6572616c732f6c6963656e7365)](https://packagist.org/packages/sanmai/japanese-numerals)

JapaneseNumeral
===============

[](#japanesenumeral)

Library to convert Japanese numeral to their Western variants (AKA Hindu-Arabic numerals)

Installation is simple:

```
composer require sanmai/japanese-numerals

```

Usage
=====

[](#usage)

To convert a number from Hindu-Arabic numerals to Japanese numerals, use:

```
$japanese = \JapaneseNumerals\JapaneseNumerals::fromArabicToJapanese(123);
var_dump($japanese);
```

Should output:

```
string(12) "百二十三"

```

To convert a string of Japanese numerals to Hindu-Arabic numerals, use:

```
$arabic = \JapaneseNumerals\JapaneseNumerals::fromJapaneseToArabic('二千二十五');
var_dump($arabic);
```

Should output:

```
string(4) "2025"

```

Known bugs
==========

[](#known-bugs)

This library isn't bug-free. Most notably it fails to interpret `九百八十三万六千七百三` as `9836703` and `二十億三千六百五十二万千八百一` as `2036521801`, examples given in [the section on large numbers in the Wikipedia article](https://en.wikipedia.org/wiki/Japanese_numerals#Large_numbers).

Acknowledgements
================

[](#acknowledgements)

Special thanks go to Navarr Barnier (@navarr) for [the initial implementation of the algorithm](https://github.com/oftn-oswg/common/blob/master/number/japanese.php).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

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 ~756 days

Total

4

Last Release

821d ago

PHP version history (3 changes)v0.1.1PHP ^7.1

v0.1.2PHP &gt;=5.6

v0.1.3PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/edcb8dde95c71b1c97c3c91e57d3548795fa2014c657744fb878e2be3b5949fc?d=identicon)[sanmai](/maintainers/sanmai)

---

Top Contributors

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

---

Tags

hindu-arabic-numeralsjapanese-numeralsphpphp-library

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/sanmai-japanese-numerals/health.svg)

```
[![Health](https://phpackages.com/badges/sanmai-japanese-numerals/health.svg)](https://phpackages.com/packages/sanmai-japanese-numerals)
```

PHPackages © 2026

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