romanize-numbers

0.1.0 • Public • Published

Romanize-Numbers

npm version Build Status License

Convert Arabic numerals into their Roman numeral equivalents.

Installation

To install the Romanize-Numbers library, use the following command:
npm install romanize-numbers

Usage

To use the Romanize-Numbers library in your project, you can import it as follows:

const { numberToRoman } = require("romanize-numbers");

You can then use the romanize function to convert Arabic numerals into their Roman numeral equivalents:

const romanNumeral = numberToRoman("big", 123);
console.log(romanNumeral); // "CXXIII"

API

romanize(number) Converts an Arabic numeral into its Roman numeral equivalent.

Arguments number (required): The Arabic numeral to convert. Returns The Roman numeral equivalent of the input number as a string.

Examples

const { numberToRoman } = require("romanize-numbers");

console.log(numberToRoman("small", 1)); // "i"
console.log(numberToRoman("small", 4)); // "iv"
console.log(numberToRoman("big", 9)); // "IX"
console.log(numberToRoman("big", 42)); // "XLII"
console.log(romanumberToRomannize("big", 3999)); // "MMMCMXCIX"

License

Romanize-Numbers is licensed under the MIT License. See the LICENSE file for more information.

Package Sidebar

Install

npm i romanize-numbers

Weekly Downloads

6

Version

0.1.0

License

MIT

Unpacked Size

5.19 kB

Total Files

5

Last publish

Collaborators

  • kkshaun