roman-utils
v1.0.5
Published
Package for parsing ints to roman digit and roman digits to ints
Maintainers
Readme
const utils = new RomanUtils(true); // true enables history recording
// Integer to Roman const result1 = utils.parse(1999); console.log(result1); // { direction: 'intToRoman', romanNumber: 'MCMXCIX', intNumber: 1999 }
// Roman to Integer const result2 = utils.parse('XLII'); console.log(result2); // { direction: 'romanToInt', romanNumber: 'XLII', intNumber: 42 }
// Access conversion history console.log(utils.record);
// Clear history utils.clearHistory();
type RomanConversionRecord = { direction?: ConversionDirection; romanNumber?: string; intNumber?: number; };
