Created
February 29, 2012 10:16
-
-
Save lmars/1939629 to your computer and use it in GitHub Desktop.
Numeral to digit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NUMERALS = { | |
'i' => 1, | |
'v' => 5, | |
'x' => 10, | |
'l' => 50, | |
'c' => 100, | |
'd' => 500, | |
'm' => 1000 | |
} | |
def digit_value(digit) | |
NUMERALS[digit] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment