Instructions
Compare the first symbol to the one immediately after it. If it is greater than or equal to the one following it, add its value to a running total, and jump ahead to Step 3.
M=1,000
D=500
C=100
L=50
X=10
V=5
I=1
So, for example, in the Roman numeral MCDLIV, M is followed by C, which is less than M, so add 1,000 to the total.
Subtract the value of the first symbol from the running total if it is less than the second symbol. Thus, if your Roman numeral is CMVII, your running total should start at -100.
Compare the second symbol to the third and, as in Step 1, if it is of greater of equal value, add it to the running total. Otherwise, subtract it.
Continue for each symbol in the Roman numeral, subtracting its value if it is followed by a greater symbol or adding its value if it is not. The final result after you have added the value of the last symbol (since it is not followed by a greater value) will be the decimal value of the Roman numeral number.