The rules for Roman numerals are as follows:
The basic symbols are I (= 1), V (= 5), X (= 10), L (= 50), C (= 100), D (= 500), and M (= 1000).
If a letter is immediately followed by one of equal or lesser value, the two numbers are added; thus, XX = 20, XV = 15, VI = 6.
Some other examples of roman numerals are: 8 = VIII 2021 = MMXXI current year
Lets write a function to output a regular number in roman numerals (i.e. 13 -> XIII)
We have node and jest test library
If a letter is immediately followed by one of greater value, the first is subtracted from the second; thus IV = 4, XL = 40, CM = 900.