# Roman Numeral Converter - I look for critics!

**URL:** <https://forum.freecodecamp.org/t/roman-numeral-converter-i-look-for-critics/479118>\
**Category:** I Built This\
**Created:** [September 24, 2021, 4:12pm UTC](https://forum.freecodecamp.org/t/roman-numeral-converter-i-look-for-critics/479118 "2021-09-24T16:12:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aki.miniaki](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/aki.miniaki/32/134621_2.png) [@aki.miniaki](https://forum.freecodecamp.org/u/aki.miniaki)\
**Post date:** [September 24, 2021, 4:12pm UTC](https://forum.freecodecamp.org/t/roman-numeral-converter-i-look-for-critics/479118/1 "2021-09-24T16:12:11Z")

</div>

After finishing the [Roman Numeral Converter](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/roman-numeral-converter) project, which is one the projects required in the Javascript Algorithms and Data Structures course. I checked some topics about it. I noticed some of those solutions used two lists, one with decimal numbers and the other one with roman numbers. I did it with one list only, the one with roman numbers. I would appreciate if you give me any feedback, critics or suggestion.

```auto
function convertToRoman(num) {
 let result = '';
 let count = 0;
 let list = [];
 let str = num.toString();
 let romans = [['', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'], ['', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'], ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM'], ['', 'M', 'MM', 'MMM']];

 for (let i = str.length - 1; i > -1; i--) {
   list.push(romans[i][parseInt(str[count])]);
   count += 1;
 }

 for (let i = 0; i < list.length; i++) {
   result += list[i];
 }

 return result;
}

convertToRoman(44);

```

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [September 24, 2021, 4:48pm UTC](https://forum.freecodecamp.org/t/roman-numeral-converter-i-look-for-critics/479118/2 "2021-09-24T16:48:24Z")

</div>

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (`</>`) to add backticks around text.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (’).

---

<div class="post-metadata">

**Author:** ![aki.miniaki](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/aki.miniaki/32/134621_2.png) [@aki.miniaki](https://forum.freecodecamp.org/u/aki.miniaki)\
**Post date:** [September 24, 2021, 6:03pm UTC](https://forum.freecodecamp.org/t/roman-numeral-converter-i-look-for-critics/479118/3 "2021-09-24T18:03:32Z")

</div>

@lasjorg Oh I see, I didn’t know how to do that. Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [March 26, 2022, 6:04am UTC](https://forum.freecodecamp.org/t/roman-numeral-converter-i-look-for-critics/479118/4 "2022-03-26T06:04:18Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
