Hi everyone! I’m tring to create the roman numeral converter. i wrote this code but there is a problem: the program works but i don’t pass the “exam”. Some one can hepls me?

```
function convertToRoman(num) {
function letM() {
let m = Math.floor(num / 1000) % 10;
switch (m) {
case 1:
return ('M');
case 2:
return('MM');
case 3:
return ('MMM');
};
}
function letC(){
let c = Math.floor(num / 100) % 10;
switch (c) {
case 0:
return('0');
case 1:
return('C');
case 2:
return('CC');
case 3:
return('CCC');
case 4:
return('CD');
case 5:
return('D');
case 6:
return('DC');
case 7:
return('DCC');
case 8:
return('DCCC');
case 9:
return('CM');
};
}
function letD(){
let d = Math.floor(num / 10) % 10;
switch (d) {
case 0:
return('0');
case 1:
return('X');
case 2:
return('XX');
case 3:
return('XXX');
case 4:
return('XL');
case 5:
return('L');
case 6:
return('LX');
case 7:
return('LXX');
case 8:
return('LXXX');
case 9:
return('XC');
};
}
function letU(){
let u = num%10;
switch (u) {
case 0:
return('0');
case 1:
return('I');
case 2:
return('II');
case 3:
return('III');
case 4:
return('IV');
case 5:
return('V');
case 6:
return('VI');
case 7:
return('VII');
case 8:
return('VIII');
case 9:
return('IX');
};
}
var roman = (`${letM()}${letC()}${letD()}${letU()}`);
roman = roman.replace(/^undefined+/, "");
roman = roman.replace(/^undefined+/, "");
roman = roman.replace(/^undefined+/, "");
roman = roman.replace(/0+/, "");
roman = roman.replace(/0+/, "");
roman = roman.replace(/0+/, "");
console.log(roman);
};
convertToRoman(36);
```