Skip to content

Validate and convert roman numbers to and from arabic.

License

Notifications You must be signed in to change notification settings

finn-vgtl/romanize

Repository files navigation

Romanize

Test and Release NPM Version MIT License semantic-release

Validate and convert roman numbers to and from arabic.

Install via npm

npm i @finn-vgtl/romanize

Usage

import { isRoman, romanize, deromanize } from '@finn-vgtl/romanize'
// or
const romanize = require('@finn-vgtl/romanize')

// validate roman numbers
isRoman('MMXXI') // true
isRoman('ABC')   // false

// romanize arabic numbers
romanize(123) // "CXXIII"

// deromanize roman numbers
deromanize("CXXIII") // 123