Tell us what’s happening:
Hi all,
I’m struggling with this one, I have gone through the roman numerals guide and understand how they work but putting that into logic is proving difficult, so far I have divided the numbers into thousands, hundreds, tens and ones. Can anyone give me a bit of direction to get the ball rolling?
Thanks.
Your code so far
function convertToRoman(num) {
let numbers = [1,4,5,9,10,40,50,90,100,400,500,900,1000];
var romanArr = ["I", "IV", "V", "IX", "X", "XL", "L", "XC", "C", "CD", "D", "CM", "M"];
let dividedNumberArray = num.toString().split("").map(function(e, i, a) {
return e * Math.pow(10, a.length - i -1)})
}
convertToRoman(16);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36
.
Challenge: Roman Numeral Converter
Link to the challenge: