@ntlab/roman

1.0.0 • Public • Published

Roman Number Parser

Usage:

const roman = require('@ntlab/roman');

// check if a string is a roman number
const str = 'CDXLIX';
if (roman.isRoman(str)) {
    console.log(`String ${str} is a roman number`);
    console.log(`Value of ${str} is %d`, roman.toInteger(str));
}

// convert number to roman
const num = 2914;
console.log(`Roman number for ${num} is %s`, roman.toRoman(num));

Readme

Keywords

Package Sidebar

Install

npm i @ntlab/roman

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

9.22 kB

Total Files

6

Last publish

Collaborators

  • tohenk