Roman numeral Converter

FreeCodeCamp have this Latin to Roman Converter-challenge where you are supposed to convert Latin numbers into old Roman ones. This is basically a Javascript-challenge, but I decided to add some markup and styling to it. As if I didn’t struggle enough with the Javascript-part… and there were more problems to come!

When putting the stuff on a web-page, I realized that the converter was correct only up to the number 4999. From 5000 one reuses the letters, but a line must be put on top to tell they are different from the small ones.

First I added some more Javascript. Still not sure if it’s correct, but at least better!  Then I had to rewrite some of the HTML as well, and I added a border-top that could act as a line on top of the biggest numbers.

Another challenge was the convert-button. The button worked fine, but when I tried to hit enter, the page collapsed. After some research i found that I didn’t know much about the problems regarding forms/submit/enter. By now I do know a little more 😉

This is my Converter:


Legg igjen en kommentar

Fyll inn i feltene under, eller klikk på et ikon for å logge inn:

Du kommenterer med bruk av din konto. Logg ut /  Endre )


Du kommenterer med bruk av din Google konto. Logg ut /  Endre )


Du kommenterer med bruk av din Twitter konto. Logg ut /  Endre )


Du kommenterer med bruk av din Facebook konto. Logg ut /  Endre )

Kobler til %s