Miss any of our Open RFC calls?Watch the recordings here! »

roman-numeral-to-decimal

1.0.1 • Public • Published

Roman numeral converter

This is a simple module that takes a single string input that represents a Roman numeral and returns the decimal equivalent number.

Install

$ npm install roman-numeral-to-decimal

Usage

Simply pass in a String of Roman numerals and see the decimal number returned! If invalid input is passed into the first argument the function will return -1. Subsequent arguments passed into the function will be ignored/unused.

const romanNumeralToDecimal = require('roman-numeral-to-decimal');
 
romanNumeralToDecimal('MCMLXXXVII') // returns the number 1987

Test

In order to run the unit tests testing the module simply enter the command below when in the root of the repository:

$ npm test

Install

npm i roman-numeral-to-decimal

DownloadsWeekly Downloads

3

Version

1.0.1

License

MIT

Last publish

Collaborators

  • avatar