Skip to content

Instantly share code, notes, and snippets.

@lmars
Created February 29, 2012 10:16
Show Gist options
  • Save lmars/1939629 to your computer and use it in GitHub Desktop.
Save lmars/1939629 to your computer and use it in GitHub Desktop.
Numeral to digit
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