PHPackages                             a1essandro/roman-numbers - 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. a1essandro/roman-numbers

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

a1essandro/roman-numbers
========================

Easy conversion int &lt;-&gt; roman numbers

010PHP

Since Feb 7Pushed 10y ago1 watchersCompare

[ Source](https://github.com/A1essandro/roman-numbers)[ Packagist](https://packagist.org/packages/a1essandro/roman-numbers)[ RSS](/packages/a1essandro-roman-numbers/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

roman-numbers
=============

[](#roman-numbers)

[![Build Status](https://camo.githubusercontent.com/7b4a0029997fc3af6e524a89622e396ef8e90e0a151a0359cb0772e780106ecb/68747470733a2f2f7472617669732d63692e6f72672f4131657373616e64726f2f726f6d616e2d6e756d626572732e737667)](https://travis-ci.org/A1essandro/roman-numbers) [![Coverage Status](https://camo.githubusercontent.com/288613e25e27a1bed446724e3430652bd848b8f5cbf24622292a96593bf9188c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f4131657373616e64726f2f726f6d616e2d6e756d626572732f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/A1essandro/roman-numbers?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/76e208bca5d391660b0847c001407be6ad909087471ad71c0ef39c1301f42fd9/68747470733a2f2f706f7365722e707567782e6f72672f6131657373616e64726f2f726f6d616e2d6e756d626572732f762f737461626c65)](https://packagist.org/packages/a1essandro/roman-numbers) [![Total Downloads](https://camo.githubusercontent.com/d6f2a96ae9174d60ddf0aa45fa17d4e00966ee9279b4ec2c750da96c7d67bcce/68747470733a2f2f706f7365722e707567782e6f72672f6131657373616e64726f2f726f6d616e2d6e756d626572732f646f776e6c6f616473)](https://packagist.org/packages/a1essandro/roman-numbers) [![Latest Unstable Version](https://camo.githubusercontent.com/b9f1eab84b2f9519cc647a1f7a34673d9d3c0b685d78acc71966c062d7f0f9f5/68747470733a2f2f706f7365722e707567782e6f72672f6131657373616e64726f2f726f6d616e2d6e756d626572732f762f756e737461626c65)](https://packagist.org/packages/a1essandro/roman-numbers) [![License](https://camo.githubusercontent.com/93917eb46c9d4c13c7ec22bed5d74ce28bbbbba75236131e9f6e9c621704e8ee/68747470733a2f2f706f7365722e707567782e6f72672f6131657373616e64726f2f726f6d616e2d6e756d626572732f6c6963656e7365)](https://packagist.org/packages/a1essandro/roman-numbers)

Easy conversion int &lt;=&gt; roman numbers

\##Requirements This package is guaranteed supported on PHP 5.3 and above.

\##Installing ###Composer See more [getcomposer.org](http://getcomposer.org).

Execute command

```
composer require a1essandro/roman-numbers

```

\##Usage

\###Basic

```
use NumberFormatter\RomanNumber;

$romanFromInt = new RomanNumber(12);
echo (string)$romanFromInt; // XII
echo $romanFromInt->toInt(); // 12

$romanFromRomat = new RomanNumber('XIX');
echo (string)$romanFromRoman; // XIX
echo $romanFromRoman->toInt(); // 19
```

\###Validation

```
try {
    new RomanNumber($someVariable);
} catch (InvalidStringException $e) {
    //if $someVariable is invalid string (not correct roman number)
} catch (InvalidIntException $e) {
    //if $someVariable is invalid int (for example -1)
} catch (InvalidArgumentException $e) {
    //if $someVariable is not int or string (invalid type)
}

//Another way to check validity:

$validRomanNumber = 'XXIX';
RomanNumber::isValidRomanNumber($validRomanNumber); // true

$invalidRomanNumber = 'XDX';
RomanNumber::isValidRomanNumber($invalidRomanNumber); // false
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/a1essandro-roman-numbers/health.svg)

```
[![Health](https://phpackages.com/badges/a1essandro-roman-numbers/health.svg)](https://phpackages.com/packages/a1essandro-roman-numbers)
```

PHPackages © 2026

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