RosettaCodeData/Task/Roman-numerals-Decode/00DESCRIPTION

14 lines
709 B
Text
Raw Permalink Normal View History

2016-12-05 22:15:40 +01:00
;Task:
Create a function that takes a Roman numeral as its argument and returns its value as a numeric decimal integer.
2013-04-10 23:57:08 -07:00
2016-12-05 22:15:40 +01:00
You don't need to validate the form of the Roman numeral.
Modern Roman numerals are written by expressing each decimal digit of the number to be encoded separately,
<br>starting with the leftmost decimal digit and skipping any '''0'''s &nbsp; (zeroes).
'''1990''' is rendered as &nbsp; '''MCMXC''' &nbsp; &nbsp; (1000 = M, &nbsp; 900 = CM, &nbsp; 90 = XC) &nbsp; &nbsp; and
<br>'''2008''' is rendered as &nbsp; '''MMVIII''' &nbsp; &nbsp; &nbsp; (2000 = MM, &nbsp; 8 = VIII).
The Roman numeral for '''1666''', &nbsp; '''MDCLXVI''', &nbsp; uses each letter in descending order.
<br><br>