Roman Numeral Converter

Convert the given number into a roman numeral.

Roman numerals Arabic numerals
M 1000
CM 900
D 500
CD 400
C 100
XC 90
L 50
XL 40
X 10
IX 9
V 5
IV 4
I 1

All roman numerals answers should be provided in upper-case.

Tests

  • Waiting: 1. convertToRoman(2) should return the string II.
  • Waiting: 2. convertToRoman(3) should return the string III.
  • Waiting: 3. convertToRoman(4) should return the string IV.
  • Waiting: 4. convertToRoman(5) should return the string V.
  • Waiting: 5. convertToRoman(9) should return the string IX.
  • Waiting: 6. convertToRoman(12) should return the string XII.
  • Waiting: 7. convertToRoman(16) should return the string XVI.
  • Waiting: 8. convertToRoman(29) should return the string XXIX.
  • Waiting: 9. convertToRoman(44) should return the string XLIV.
  • Waiting: 10. convertToRoman(45) should return the string XLV.
  • Waiting: 11. convertToRoman(68) should return the string LXVIII
  • Waiting: 12. convertToRoman(83) should return the string LXXXIII
  • Waiting: 13. convertToRoman(97) should return the string XCVII
  • Waiting: 14. convertToRoman(99) should return the string XCIX
  • Waiting: 15. convertToRoman(400) should return the string CD
  • Waiting: 16. convertToRoman(500) should return the string D
  • Waiting: 17. convertToRoman(501) should return the string DI
  • Waiting: 18. convertToRoman(649) should return the string DCXLIX
  • Waiting: 19. convertToRoman(798) should return the string DCCXCVIII
  • Waiting: 20. convertToRoman(891) should return the string DCCCXCI
  • Waiting: 21. convertToRoman(1000) should return the string M
  • Waiting: 22. convertToRoman(1004) should return the string MIV
  • Waiting: 23. convertToRoman(1006) should return the string MVI
  • Waiting: 24. convertToRoman(1023) should return the string MXXIII
  • Waiting: 25. convertToRoman(2014) should return the string MMXIV
  • Waiting: 26. convertToRoman(3999) should return the string MMMCMXCIX
/**
* Your test output will go here
*/