2017 © Pedro PelĂĄez
 

library roman-numerals

image

komakino/roman-numerals

  • Friday, September 16, 2016
  • by komakino
  • Repository
  • 1 Watchers
  • 2 Stars
  • 1,477 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 30 % Grown

The README.md

Roman Numerals

Composer package for conversion between integer values and roman numerals., (*1)

Handles numbers from 0 to 3999. For 0 the string 'nulla' is used., (*2)

Installation

To add this package as a dependency to your project, simply add a dependency on komakino/roman-numerals to your project's composer.json file., (*3)

    {
        "require": {
            "komakino/roman-numerals": "*"
        }
    }

Usage

use Komakino\RomanNumerals\RomanNumerals;

$roman   = RomanNumerals::to(2016);       // returns 'MMXVI'
$integer = RomanNumerals::from('DCLXVI'); // returns 666

Public static methods

  • string to($integer), (*4)

    • Converts integer to roman numerals
    • If integer is negativ, an OutOfBoundsException is thrown
    • If integer is larger or equal to 4000, an OutOfBoundsException is thrown
  • string from($string), (*5)

    • Converts roman numerals to integer
    • If string contains illegal characters, an InvalidArgumentException is thrown

Changelog

v1.0.0

  • Initial public release

v1.0.1

  • New README file

v1.0.2

  • Added license and author to composer.json

v1.0.3

  • Added LICENSE file

The Versions

16/09 2016

dev-master

9999999-dev

  Sources   Download

MIT

The Development Requires

16/09 2016

v1.0.2

1.0.2.0

  Sources   Download

MIT

The Development Requires

13/02 2016

v1.0.1

1.0.1.0

  Sources   Download

The Development Requires

13/02 2016

v1.0.0

1.0.0.0

  Sources   Download

The Development Requires