Java application for Arabic-Roman and Roman-Arabic numeral conversion.
To launch the app simlpy download executable jar file - target/ArabicRomanConverter-1.3.jar.
Starting point is a rules reminder:
Input is case insensitive, trimmed from both ends:
In case of violation of rules or typo you'll get an error message:
Roman numerals are based on the following symbols:
Symbol | Value |
---|---|
I | 1 |
V | 5 |
X | 10 |
L | 50 |
C | 100 |
D | 500 |
M | 1000 |
Only the digits I, X, C and M can be repeated up to three times.
Example:
Legal | Illegal |
---|---|
MMM | CCCC |
CCC | IIII |
II | VV |
When a digit of lower value is written to the right or after a digit of higher value, then the values of all digits are added.
Example:
CCXXX | C + C + X + X + X | 100 + 100 + 10 + 10 + 10 |
---|---|---|
MMXIII | M + M + X + I + I + I | 1000 + 1000 + 100 + 1 + 1 + 1 |
When a digit of lower value is written to the left or before a digit of higher value, then the value of the lower digit is subtracted from the value of the higher digit.
Example:
XXIV | X + X + |I - V| | 10 + 10 + 4 |
---|---|---|
CMXLIX | |C - M| + |X - L| + |I - X| | 900 + 40 + 9 |