TypeScript package that converts arabic number to roman notation
npm install typescript-roman-numbers-converter
Typescript Roman Numbers Converter
==============

A simple and easy to use Typescript package that converts a given arabic number to roman number format
$ npm install --save typescript-roman-numbers-converter
import { toRoman } from "typescript-roman-numbers-converter";
let a: number;
let r: string;
a = 32
r = toRoman(a); //r is now equal to "XXXII"
let a_2 = -12
r = toRoman(a_2); //r is now "" due to limitations
let a: number;
let r: string;
r = "XXXII"
a = toArabic(a); //a is now equal to 32
let b = isRoman("MCM"); //b is true
let b_2 = isRoman("ABC"); //b_2 is false
class RomanNumber {
//holds the numeric value of the number
num: number;
//holds the roman numeral that represents the value ofnum
str: string;
// elaborations fields for use the large conversion
baseUnits: number = 0;
thousands: number = 0;
constructor(num: number, str: string) {
this.num = num;
this.str = str;
}
}
let a: number;
let r: RomanNumber(0,'');
let r_2: string;
a = 1350021
r = toRomanLarge(a); //r is now equal to {num: 1350021, str: "(_MCCCL)XXI", baseUnits: 21, thousands: 1350}
r_2 = toRomanLargeStr(a); //r_2 is now equal to "(_MCCCL)XXI"