usualoma
3/17/2013 - 7:41 PM

num.rb

$><<('%d千%d百%d十%d'%('%04d'%$*).chars).gsub(/1(.)|0.?|(\d)/){$2?'.一二三四五六七八九'[eval$2]:$1}