Skip to content

Instantly share code, notes, and snippets.

View gonglexin's full-sized avatar

Lexin Gong gonglexin

View GitHub Profile
@gonglexin
gonglexin / chinesedecimal.rb
Created April 14, 2010 10:58 — forked from xiaods/chinesedecimal.rb
Ruby:convert RMB currency to chinese describe
$KCODE = 'u'
# Goal: 小写金额转换为大写金额
# Limit: 金额整数位支持到亿位,小数点后支持两位并且不支持四舍五入
class ChineseFee
attr_reader :chn_numbers, :chn_units, :chn_decimals
def initialize
@chn_numbers = %w( )
@chn_units = %w( 拾万 佰万 仟万 亿)