Skip to content

Instantly share code, notes, and snippets.

View sgronblo's full-sized avatar
🆒
Focusing

Sam Grönblom sgronblo

🆒
Focusing
  • Reaktor Japan
  • Tokyo
View GitHub Profile
@sgronblo
sgronblo / kanji_to_number.rb
Created June 19, 2012 06:55 — forked from Kimtaro/kanji_to_number.rb
Convert Kanji numerical to roman numerical
# Encoding: UTF-8
module KanjiToNumber
MULTIPLIERS = {'十' => 10, '百' => 100, '千' => 1000, '万' => 10000}
NUM_FOR_NUM = {'壱' => 1, '一' => 1, '1' => 1,
'弐' => 2, '二' => 2, '2' => 2,
'参' => 3, '三' => 3, '3' => 3,
'四' => 4, '4' => 4,
'五' => 5, '5' => 5,
'六' => 6, '6' => 6,