convert decimal to roman numerals
function convertToRoman(num)
{
let map = {
1000 : "M",
900 : "CM",
500 : "D",
400 : "CD",
100 : "C",
90: "XC",
50: "L",
40: "XL",
10: "X",
9: "IX",
5: "V",
4: "IV",
1: "I"
}
let roman = "";
let romankeys = Object.keys(map).reverse();
romankeys.forEach((keys) => {
while(keys <= num)
{
roman += map[keys];
num -= keys;
}
});
return roman;
}
//https://www.rapidtables.com/convert/number/how-number-to-roman-numerals.html (The refrence for the Roman Calculator)
console.log(convertToRoman(20));