- For any input other than a number between 0 and 4,000, an error message is displayed.
- Example Input: 5000
- Example Output: Please enter a number between 0 and 4,000.
- For a single-digit numerical input, the corresponding Roman Numerals are added together.
- Example Input: 8
- Example Output: IIIIIIII
- For a single-digit numerical input where the corresponding Roman Numerals result is more than three consecutive symbols, convert to the symbol of the next highest value.
- Example Input: 4
- Example Output: V
- After applying the previous rule, then find the difference between the higher value symbol and the original input, and place the value of this difference to the left of the higher value symbol.
- Example Input: 4
- Example Output: IV
- For a multi-digit numerical input, examine the digit in each place (ones, tens, hundreds, thousands) separately, converting it to Roman Numerals using the above rules.
- Example Input: 99
- Example Output: XCIX
- Clone this repository.
- Open the index.html file in a browser.
A live version of this project can be viewed at https://jpremmel.github.io/roman-numerals/.
JavaScript, jQuery
Open-source
Copyright (c) 2019 Lauren Musante, Sofia Giordano, and Jacqueline Remmel